Compare commits

...

259 Commits

Author SHA1 Message Date
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 20e44e4033 Merge pull request 'Add mod.confs to silence Minetest 5.5 warnings' (#298) from rudzik8/Mineclonia:add-mod-confs into master
Reviewed-on: Mineclonia/Mineclonia#298
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-11 23:33:15 +00:00
Mikita Wiśniewski ac3031c679 Add mod.confs to silence Minetest 5.5 warnings 2022-05-11 07:09:15 +07:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 54f72a1457 Merge pull request 'ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards' (#293) from move-farming-plants-lower into master
Reviewed-on: Mineclonia/Mineclonia#293
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-04-30 22:01:30 +00:00
Nils Dagsson Moskopp 0808b54192
Render mcl_farming plant stems 1/16 node lower
This patch shifts mcl_farming nodes that represent a stem 1/16 nodes
downwards. It also replaces the plantlike drawtype of mcl_farming nodes
that represent an unconnected stem (x) with a nodebox drawtype that
looks like a plus (+), as Minetest has no option to rotate nodeboxes.
The goal is to remove the gap between plants and farming soil with a
node height of 15/16.

This patch affects melon stem and pumpkin stem nodes.
2022-04-21 02:45:36 +02:00
Nils Dagsson Moskopp 14cbc63b5f
Render mcl_farming plant grids 1/16 node lower
This patch replaces the plantlike drawtype of mcl_farming plant nodes
that are rendered like a grid (#) with a nodebox drawtype. The nodebox
looks like a plantlike grid shifted 1/16 nodes downwards. The goal is to
remove gaps between plants and farming soil with a node height of 15/16.

This patch affects beetroot, carrots, potatoes, and wheat nodes.
2022-04-21 02:44:45 +02:00
Nils Dagsson Moskopp de8ea11b39
Add debug command to spawn mcl_farming plant nodes
This patch adds the debug command “/generate_farming_plant_rows”. The
command generates rows of plants and stems per plant type near a player.
A farming soil or glass node is placed below each node, so players can
find and examine possible gaps between a plant node and a node below.
2022-04-18 21:43:21 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 1ce88e7528 Merge pull request 'ITEMS/mcl_tnt: Add setting for TNT drop rate (default 100%)' (#291) from add-tnt-drop-rate-setting into master
Reviewed-on: Mineclonia/Mineclonia#291
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-04-18 19:36:10 +00:00
Nils Dagsson Moskopp 6e11819b79
Increase TNT drop rate to 100%
This makes the TNT drop rate match Minecraft 1.14.
2022-04-17 18:44:09 +02:00
Nils Dagsson Moskopp 5acc9191fa
Add setting for TNT drop rate 2022-04-17 18:42:46 +02:00
Nils Dagsson Moskopp 32d89d6d5f
Add TNT test structure
This patch adds a new test structure to the “/spawnstruct” command which
can be spawned with this command: /spawnstruct test_structure_tnt

The structure was added to reduce manual work when examining or
verifying TNT explosion results after changes to TNT drop rate.
2022-04-17 17:24:54 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. d2c335d8fb Merge pull request 'ITEMS/mcl_farming: Use uncarved pumpkin in survival' (#285) from uncarved-pumpkin-4 into master
Reviewed-on: Mineclonia/Mineclonia#285
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-04-15 22:51:58 +00:00
Nils Dagsson Moskopp 7d2ef66175
Trigger node callbacks when pumpkin is sheared
The code for shearing a pumpkin used minetest.swap_node() to replace a
faceless pumpkin with a carved pumpkin. This did not trigger the node
callbacks of the carved pumpkin, which meant that shearing a pumpkin
would not check for the snow golem or iron golem spawn conditions.

This patch replaces minetest.swap_node() in the code for shearing a
pumpkin with minetest.set_node(), which does trigger the callbacks;
therefore snow and iron golems can now spawn as a pumpkin is carved.
2022-04-14 18:52:31 +02:00
Nils Dagsson Moskopp fdd3c5db86
Drop carved pumpkin when shearing snow golem 2022-04-14 00:23:01 +02:00
Nils Dagsson Moskopp c4912effaf
Disconnect gourd stems after destruct
While testing the previous commit, it became clear that gourd stems do
not disconnect properly if the gourd disappears while not being dug. A
simple method to create illegal curved stems was to explode the gourd.

This patch changes gourds so that the stem curves back after a gourd is
destroyed, regardless of reason. This hopefully makes curved stems that
are not connected to matching gourds a relict of the past.
2022-04-14 00:23:01 +02:00
Nils Dagsson Moskopp 1967e10a52
Disconnect stems from carved pumpkins after dig
Carved pumpkins can end up being connected to a stem – either if they
were grown in a previous version of MineClone2 or Mineclonia, or if a
player carves them before harvesting them. This patch makes sure that
stems turn into unconnected stems after such a carved pumpkin is dug.
2022-04-14 00:23:00 +02:00
Nils Dagsson Moskopp f8d55ee61b
Make villagers accept uncarved pumpkin in trades
As map generation and growing mechanics have been changed to generate
uncarved pumpkins instead of carved, requiring players to shear every
pumpkin before trading it with villagers seems like useless busywork.
2022-04-14 00:23:00 +02:00
Nils Dagsson Moskopp 3948a0e7af
Remove pumpkin pie recipe with carved pumpkin
Shearing an uncarved pumpkin turns it into a carved pumpkin and drops
four pumpkin seeds. As map generation and growing mechanics have been
changed to generate uncarved pumpkins instead of carved, preserving a
recipe to get pumpkin pie from carved pumpkins enabled players to get
both seeds and pumpkin pie from grown pumpkins, which was unintended.
2022-04-14 00:22:59 +02:00
Nils Dagsson Moskopp a44fd9c88b
Remove pumpkin seeds recipe with carved pumpkin
Shearing an uncarved pumpkin turns it into a carved pumpkin and drops
four pumpkin seeds. As map generation and growing mechanics have been
changed to generate uncarved pumpkins instead of carved, preserving a
recipe to get seeds from carved pumpkins enables players to get twice
the amount of seeds as intended. Because of this, the recipe must go.
2022-04-14 00:22:59 +02:00
Alexander Minges 6381d65dbb
Use correct location for pumpkin shearing sound
The code for turning an uncarved pumpkin into a carved pumpkin using
the shears was using “above” instead of “pointed_thing.above” as the
location for its sound. This resulted in a warning being logged when
shears were being used on a pumpkin. This patch rectifies the issue.
2022-04-14 00:22:59 +02:00
Alexander Minges 59b013f766
Grow uncarved pumpkin from seeds instead of carved
Carved pumpkin has to be explicitly registered as a separate node, as
registering a carved pumpkin node happened as a side effect of invoking
mcl_farming:add_gourd() for the carved pumpkin.

The iron / snow golem spawning checks that trigger whenever a carved
pumpkin is placed had to be moved out of the mcl_farming:add_gourd()
invocation to preserve the existing behaviour.

Note that uncarved pumpkin must not be registered as a separate node,
as invoking mcl_farming:add_gourd() for a registered node name leads to
stems not updating when an adjacent node is manually placed or mined.
2022-04-14 00:22:58 +02:00
Alexander Minges d59888c4df
Use uncarved pumpkin instead of carved in mapgen 2022-04-14 00:22:58 +02:00
cora 8810a24ce0 Merge pull request 'ITEMS/REDSTONE/mcl_comparators: Fix redstone comparator flooding crash' (#284) from fix-comparator-cauldron-water-crash into master
Reviewed-on: Mineclonia/Mineclonia#284
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-02-23 22:30:44 +00:00
Nils Dagsson Moskopp be915478af
Fix redstone comparator flooding crash
Redstone comparators have two modes, comparison mode & subtraction mode.
Before this patch, the functions to turn comparators on or off attempted
to swap nodes with comparators in the same mode, but failed to determine
the correct replacement node, if the existing node was not a comparator.

When a comparator in an on state (e.g. powered by a filled cauldron) was
flooded, the flooding dropped the comparator and replaced the comparator
node that was to be swapped out with air, which lead to a server crash.

This patch changes the functions that turn comparators on or off so they
only swap existing nodes with comparators in the same mode if the name
of the replacement node can be determined – i.e. if it is not nil.
2022-02-23 00:27:56 +01:00
Nils Dagsson Moskopp d9764fdac6
Add comparator test structure
This patch adds a new test structure to the “/spawnstruct” command which
can be spawned with this command: /spawnstruct test_structure_comparator

The structure was added to reduce manual work when examining or
verifying comparator behaviour after changes to comparator code.
2022-02-22 23:48:10 +01:00
cora de9f2479eb Merge pull request 'HUD/mcl_tmp_message: Add setting for temporary message display duration (default: 10s)' (#266) from tmp-message-timeout-increase into master
Reviewed-on: Mineclonia/Mineclonia#266
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-02-18 10:59:47 +00:00
Nils Dagsson Moskopp c128d43321
Increase temporary message display duration to 10s 2022-02-12 17:25:09 +01:00
Nils Dagsson Moskopp e7070c034c
Add setting for temporary message display duration 2022-02-12 17:25:03 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 18e299d923 Merge pull request 'ITEMS/mcl_fire: Fix fire spread to not freeze the game' (#234) from fix-fire into master
Reviewed-on: Mineclonia/Mineclonia#234
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2022-02-12 03:39:40 +00:00
cora f5ba6f5649
Fix memory leak & C stack overflow
Before this patch, when placing a fire above a node that would turn it
into eternal fire (e.g. Netherrack or Magma) the spawn_fire() function
would call itself infinitely via the on_construct() handler of eternal
fire – because the latter called spawn_fire() itself.

On an x86 machine, this caused a memory leak, hanging Minetest. On an
x86_64 machine though, Minetest crashed immediately, showing an error
message about a stack overflow.
2022-02-11 17:44:11 +01:00
cora 4647710945
Extinguish fire without nearby “fuel” faster
This patch adjusts how often the ABM runs that removes fire nodes with
no adjacent nodes that can burn up. This makes fire linger less in air.
2022-02-11 17:44:10 +01:00
cora 5d09ec311c
Extinguish fire using an ABM instead of timers
Even the mitigated timers seem to have lead to slow
memory leaks. Once Minetest has used up all the RAM,
it will free some, then quickly use memory up again,
then repeat it ad nauseum, requiring 100% CPU. On a
PC with 2GB of RAM this could be reliably triggered
by having a fire burn a forest for 20 to 30 minutes.

This patch removes fire node timers completely and
instead extinguishes fire using an ABM.
2022-02-11 17:44:09 +01:00
cora ef7370550f
Make fire spread direction truly random
This patch initializes the random number generator used in mcl_fire with
the current Unix timestamp. It also corrects two biases in fire spread
that were caused by nodes being iterated over in a predictable way.
2022-02-11 17:41:42 +01:00
cora 6c2fb98160
Fix nodes with “flammable = -1” not catching fire 2022-02-07 04:51:27 +01:00
cora 052c9fcbcf
Fix diagonal fire-spread
In Minecraft fire spread logic, “adjacent” does not mean “diagonal”.
2022-02-07 04:51:06 +01:00
cora db8fbdc5dd
Fix beds burning away and dropping 2022-02-07 03:39:52 +01:00
cora 1b89c15193
Fix double nodes not being properly removed 2022-02-07 03:39:51 +01:00
cora 02fa2c9e07
Fix nodes that should not burn up burning up
Nodes with the group “flammable = -1” (e.g. crafting tables) must be
able to catch fire, but must not burn up. This patch adds checks for
this group.
2022-02-07 03:39:51 +01:00
cora c12076e74d
Reimplement basic Minecraft-like fire spread 2022-02-07 03:39:45 +01:00
cora 4deca628dc
Make fire actually remove nodes 2022-02-07 03:22:15 +01:00
cora df4ea94dbc
Add node timer back in so fires burn out 2022-02-07 03:22:02 +01:00
cora 8e8ccddb68
Replace MineClone2 fire with Minetest Game ABMs
ABMs have better performance than the laggy timer-based implementation.
2022-02-07 03:18:54 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 11469886e0 Merge pull request 'MAPGEN/mcl_structures: Add (theoretically) fireproof test structure' (#258) from add-fireproof-structure into master
Reviewed-on: Mineclonia/Mineclonia#258
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-02-07 01:24:58 +00:00
Nils Dagsson Moskopp 96822be63d
Add (theoretically) fireproof test structure
This patch adds a new test structure to the “/spawnstruct” command which
can be spawned with this command: /spawnstruct test_structure_fireproof

The structure can be used to verify that eternal fire can be spawned by
the structure placement code. It can also be used to debug fire spread,
as according to Minecraft fire spread rules, it should be fireproof.

See <https://minecraft.fandom.com/wiki/Fire#Spread> for those rules.
2022-02-06 01:19:23 +01:00
cora 6abdbbbd13 Merge pull request 'ENTITIES/mcl_boats: Fix mob-in-boat crash in Minetest 5.5-dev' (#249) from fix-boat-crash-in-minetest-5.5-dev into master
Reviewed-on: Mineclonia/Mineclonia#249
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-01-27 00:50:08 +00:00
Nils Dagsson Moskopp f89c52dff6
Fix mob-in-boat crash in Minetest 5.5-dev
In Minetest 5.4.1, calling get_player_control() on a mob returned the
empty string. Minetest commit 5eb45e1ea03c6104f007efec6dd9c351f310193d
changed this, so now calling get_player_control() on a mob returns nil.

As mcl_boats defines boats that can have a player or a mob as a driver,
code like the following crashes with a changed get_player_control() API:

local ctrl = driver:get_player_control()
if ctrl.sneak then
    detach_object(driver, true)
end

Furthermore, once a world has crashed, joining it near a mob that is the
driver of a boat with such control code immediately crashes again.

When I reported this bug to Minetest, several Minetest core developers
stated that they disliked the old API and proposed other return values
for calling a mob's get_player_control() function – all different from
the empty string. Since I have some doubts that this bug will be fixed
in Minetest 5.5.0, boat code must take into account a nil return value.

Minetest issue: https://github.com/minetest/minetest/issues/11989
2022-01-26 18:25:08 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. b1b96e3fac Merge pull request 'ITEMS/mcl_armor: Fix armor rendering when wearing pumpkin' (#244) from fix-pumpkin-armor-rendering-2 into master
Reviewed-on: Mineclonia/Mineclonia#244
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-01-23 19:59:13 +00:00
epCode 6bfb97842f
Fix armor rendering when wearing pumpkin
Before this patch, wearing a pumpkin would make body armor render as a
corrupted item held in the player's left hand instead of on their body.
Some parts of their armor would also get rendered on the player's feet.

(cherry picked from commit 12192d1a8ddffdae1ec13ea8f6efc6fe2465c2b8)
2022-01-23 20:11:55 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 3b92d060f4 Merge pull request 'HUD/mcl_inventory: Fix creative mode inventory search crash' (#237) from fix-creative-inventory-crash into master
Reviewed-on: Mineclonia/Mineclonia#237
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-01-22 16:49:19 +00:00
Nils Dagsson Moskopp f975055464
Fix creative mode inventory search crash
Before this patch it was possible for any user to to crash Minetest in
creative mode. This was possible because queries in the search field
were interpreted as search patterns for string.find().

A search for a single square bracket would reliably crash the server.
Also, a search for 6000 times the string “a?” would hang the server.

The solution to both bugs is to not interpret the query as a pattern.
2022-01-21 23:31:25 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 23f1c51912 Merge pull request 'ITEMS/mcl_farming: Convert correct floor node to dirt as gourd grows' (#231) from fix-gourd-farmland-dirtification into master
Reviewed-on: Mineclonia/Mineclonia#231
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-01-15 22:07:24 +00:00
Nils Dagsson Moskopp 4d02af8c94
Convert correct floor node to dirt as gourd grows
Before this patch, growing a gourd (e.g. melon, pumpkin) would always
convert a node west of the node below the stem to dirt if belonged to
the group “dirtifies_below_solid”. This happened because of a loop in
which the variables floorpos and floor were re-used without setting a
new value … therefore, both floorpos and floor were always containing
the last values set in a previous loop instead of the correct values.

This patch fixes the problem by setting both variables in both loops.
2022-01-13 07:29:57 +01:00
Li0n_2 7ede0ca79a Merge pull request 'Fix shearsy wool typo in GROUPS.md' (#229) from JosiahWI/Mineclonia:fix-groups-typo into master
Reviewed-on: Mineclonia/Mineclonia#229
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2022-01-12 21:19:10 +00:00
JosiahWI e2e7e15b39
fix one character typo in GROUPS.md 2022-01-12 11:09:07 -06:00
cora 93a0879b40 Merge pull request 'MISC/mcl_selftests: Do not crash if minetest.find_nodes_in_area() lies' (#214) from fix-selftest-crash into master
Reviewed-on: Mineclonia/Mineclonia#214
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-12-20 22:42:59 +00:00
Nils Dagsson Moskopp 0b5fa14041 Do not crash if minetest.find_nodes_in_area() lies 2021-12-20 21:38:24 +01:00
cora 4f33f626f5 Merge pull request 'ITEMS/mcl_chests: Reskin chests as presents on December 24th to 26th' (#212) from add-christmas-chests into master
Reviewed-on: Mineclonia/Mineclonia#212
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-12-20 16:34:54 +00:00
Nils Dagsson Moskopp df7bd78af5
Add noise to christmas chest textures 2021-12-12 15:40:29 +01:00
Nils Dagsson Moskopp fe3e837e1b
Reskin chests as presents on December 24th to 26th 2021-12-11 18:17:53 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 6f811b3cee Merge pull request 'ITEMS/mcl_chests: Spawn small chest entities only if animated chests are enabled' (#207) from fix-animchest-setting into master
Reviewed-on: Mineclonia/Mineclonia#207
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-12-11 14:27:24 +00:00
Lizzy Fleckenstein dfa56f229f
Spawn small chest entities only if animated chests are enabled 2021-12-10 22:15:53 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. ee77f33ea8 Merge pull request 'PLAYER/mcl_playerplus: send player object props only if changed' (#147) from fix-active-object-message-spam into master
Reviewed-on: Mineclonia/Mineclonia#147
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-12-09 09:31:09 +00:00
cora 5deaabdb47
Fix player bone positions and properties setting
The comparison and setting logic in the previous patch that set player
bone positions and properties conditionally incorrectly did not update
some values (like player eye level position) when they changed. This
patch fixes it and adds asserts to ensure the code works as intended.
2021-12-09 04:53:45 +01:00
cora d77f31eab8
Only set/send player properties if necessary
Before this patch, Mineclonia set (and therefore sent) player bone
positions and player properties in every globalstep. This results in
about 30 TOCLIENT_ACTIVE_OBJECT_MESSAGE per second per player. This
patch adds conditional functions to set bone positions and properties.
The functions set values only when they have changed, reducing traffic.
2021-12-09 04:26:22 +01:00
cora 10670d5c10 Merge pull request 'HUD/mcl_death_messages: Fix crash when skeleton kills player using bow' (#202) from fix-skelly-crash-2 into master
Reviewed-on: Mineclonia/Mineclonia#202
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-12-06 18:42:20 +00:00
Nils Dagsson Moskopp 609105e091
Add test cases for get_tool_name() 2021-12-06 04:11:55 +01:00
cora f9e3c4fd6d
Fix crash when skeleton kills player using bow
Commit 5252952555 used string.gsub() to
strip newlines from tools in death messages. The second return value of
string.gsub() (the number of substitutions) was erroneously returned too
by get_tool_name(). This bug caused a crash whenever a skeleton killed a
player using its bow.
2021-12-06 03:48:39 +01:00
cora d70c05e92c Merge pull request 'ITEMS/mcl_chests: Fix access to ender chest inventory without an ender chest' (#193) from EliasFleckenstein03/Mineclonia:enderchest-fix into master
Reviewed-on: Mineclonia/Mineclonia#193
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-12-04 13:25:26 +00:00
Lizzy Fleckenstein cacddd3fb4
Fix access to ender inventory without an ender chest 2021-12-03 21:23:10 +01:00
cora dd347c50c5 Merge pull request 'ITEMS/mcl_chests: Add debug command to show ender chest inventory formspec.' (#194) from add-enderchest-command into master
Reviewed-on: Mineclonia/Mineclonia#194
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-12-03 10:53:51 +00:00
Nils Dagsson Moskopp 54b36c42a9
Add debug command to show ender chest inventory formspec. 2021-12-02 19:44:22 +01:00
cora 5252952555 strip newlines from tools in death messages
Players naming their tools with newlines can mess up chat with death
messages. This commit strips out newlines (\r and \n ) in the tool
name for death messages.
2021-12-01 13:25:57 +00:00
Li0n_2 c08f9850f6 Merge pull request 'Add packed ice crafting recipe' (#180) from add-packed-ice-crafting-recipe into master
Reviewed-on: Mineclonia/Mineclonia#180
Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
2021-11-27 23:43:28 +00:00
Nils Dagsson Moskopp f8b5066c61
Add packed ice crafting recipe 2021-11-24 06:06:26 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 4b9094ddc2 Merge pull request 'ITEMS/mcl_core: remove swiftness from egapps' (#177) from fix-egapp-speed into master
Reviewed-on: Mineclonia/Mineclonia#177
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-11-20 01:21:11 +00:00
cora 5087e8194a remove swiftness from egapps
The minetest world is already so small that you can reach world
border from spawn in about 2 hours. I think the regen and fire
resistance are  good enough to make them special.
2021-11-20 02:14:16 +01:00
cora 71befcff10 Merge pull request 'ENTITIES/mcl_mobs: Give mobs sunburn at correct light level' (#175) from fix-mobs-burning-in-sunlight into master
Reviewed-on: Mineclonia/Mineclonia#175
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-11-19 20:27:55 +00:00
Nils Dagsson Moskopp 66dd87af25
Give mobs sunburn at correct light level
Before this patch, the light level that makes mobs that burn in sunlight
catch fire had been mistakenly specified as minetest.LIGHT_MAX or more.

The correct light level for sunlight is LIGHT_SUN, which is one higher
than minetest.LIGHT_MAX. Since minetest.LIGHT_MAX is the maximum light
value that a node can have and torches emit light at that light level,
mobs that burn in sunlight caught fire inside torch nodes.
2021-11-19 03:14:36 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. fc47f0a87e Merge pull request 'CORE/mcl_colors: Add mod providing global color values' (#172) from add-mcl-colors into master
Reviewed-on: Mineclonia/Mineclonia#172
Reviewed-by: Li0n <li0nsdichachu@outlook.com>
2021-11-18 20:57:08 +00:00
Nils Dagsson Moskopp 6bd4b0e62c
Fix typo in mcl_colors API documentation 2021-11-18 19:23:57 +01:00
AFCMS 3473f55136
Add API documentation to mcl_colors 2021-11-18 19:14:21 +01:00
Lizzy Fleckenstein af7f7c3574
Add mcl_colors 2021-11-18 19:13:08 +01:00
cora 434e545745 Merge pull request 'MISC/mcl_engine_workarounds: Add crash fix and tests for minetest.find_nodes_in_area()' (#169) from fix-find-nodes-in-area-3 into master
Reviewed-on: Mineclonia/Mineclonia#169
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-11-18 11:43:57 +00:00
Nils Dagsson Moskopp 76d2846c59
Improve test for minetest.find_nodes_in_area()
• By emerging test areas, the test gets real map data and does not block.
• The test now also ensures that any return values are compared exactly.
• minetest.find_nodes_in_area() is tested with the “grouped” parameter.
2021-11-18 04:47:03 +01:00
Nils Dagsson Moskopp 526c25aa57
Add crash fix and tests for minetest.find_nodes_in_area()
For some specific out of bounds values, the volume calculation in
minetest.find_nodes_in_area() is off by about four million nodes.
Unfortunately that behaviour made it trivial to crash Mineclonia,
as Minetest immediately crashes upon encountering large numbers.

This commit introduces a wrapper around minetest.find_nodes_in_area()
which should avoid a crash. Additionally, three self tests are executed
when a server starts; they crash Mineclonia in case the workaround fails.
2021-11-18 00:55:59 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 249cfb8118 Merge pull request 'ENTITIES/mcl_burning: Fix burning animation packetspam' (#149) from fix-burning-animation-packetspam into master
Reviewed-on: Mineclonia/Mineclonia#149
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-11-13 01:34:17 +00:00
cora 84194b71e6 burning: prevent adding multiple entities+huds 2021-11-12 01:16:16 +01:00
cora 0b7097cb28 add a burning animation fps setting 2021-11-12 01:16:16 +01:00
cora bfbc953b92 Merge pull request 'ENTITIES/mcl_burning: Add debug command to burn a player' (#164) from add-burn-command-2 into master
Reviewed-on: Mineclonia/Mineclonia#164
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-11-11 22:25:14 +00:00
Nils Dagsson Moskopp 253100380c
Add debug command to burn a player 2021-11-11 21:37:26 +01:00
cora df98db1d8c Merge pull request 'ITEMS/mcl_banners: Render preview banners with transparent patterns correctly' (#158) from banner-mask-fix-4 into master
Reviewed-on: Mineclonia/Mineclonia#158
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-11-08 12:21:50 +00:00
Nils Dagsson Moskopp f410de485a
Render preview banners with transparent patterns correctly
Without this fix, the banner pattern preview generation does not mask
the banner pattern, so the alpha channel of the banner pattern is not
taken into account. This lead to preview banners with color gradients
showing up as a solid color banner and opaque pixel artifacts for the
bottom triangle pattern.
2021-10-31 20:53:18 +01:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 3a78211be4 Merge pull request 'ITEMS/mcl_maps: send hud_flags only if actually changed' (#146) from fix-minimap-spam into master
Reviewed-on: Mineclonia/Mineclonia#146
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-09-15 17:20:34 +00:00
cora eee94658e7 mcl_maps: send hud_flags only if actually changed 2021-09-13 14:15:32 +02:00
cora 07a59ef120 Merge pull request 'Add dirt node group documentation' (#142) from add-dirt-group-documentation into master
Reviewed-on: Mineclonia/Mineclonia#142
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-09-08 01:39:32 +00:00
Nils Dagsson Moskopp e1462d9534
Add dirt node group documentation 2021-09-08 03:16:19 +02:00
cora 42a076cc0b Merge pull request 'ITEMS/mcl_core: Add debarking and stripped trunk / wood' (#135) from stripped-wood-3 into master
Reviewed-on: Mineclonia/Mineclonia#135
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-09-07 01:41:01 +00:00
NO11 3759d50344
Add german translation for stripped wood 2021-09-07 00:48:40 +02:00
NO11 50e913b370
Add template for stripped wood translation 2021-09-07 00:48:39 +02:00
NO11 508b08dfd3
Add specific help text for stripped wood 2021-09-07 00:48:38 +02:00
NO11 68646b62b3
Add some spaces 2021-09-07 00:48:38 +02:00
NO11 d3348ef8b7
Add stripped trunk / wood textures
Stripped trunk / wood nodes exist for acacia, birch, dark oak, jungle
tree, oak, and spruce. This patch adds the textures for all of these.
2021-09-07 00:48:37 +02:00
NO11 eadb96dd40
Refactor wooden plank crafting
This patch makes it possible to craft planks out of stripped wood.
2021-09-07 00:48:36 +02:00
NO11 616b009452
Add stripped trunk and stripped wood nodes 2021-09-07 00:48:35 +02:00
NO11 a92e1c05a3
Add debarking by right clicking wood using an axe 2021-09-07 00:48:10 +02:00
cora b26fb44aeb Merge pull request 'New Mineclonia logo' (#140) from add-mineclonia-menu-header into master
Reviewed-on: Mineclonia/Mineclonia#140
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-08-27 02:53:11 +00:00
Li0n 19112bfbec
New Mineclonia logo 2021-08-27 04:09:35 +02:00
cora 6f046b199d Merge pull request 'Add Mineclonia menu icon' (#139) from add-mineclonia-menu-icon into master
Reviewed-on: Mineclonia/Mineclonia#139
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-08-27 01:31:19 +00:00
Nils Dagsson Moskopp 7f4f5c5c89
Make menu icon export compatible with Inkscape 1.0
Though usually one would export directly to "${3}", Inkscape 1.0 had
its command line options changed by people who apparently think that
backwards compatibility is some kind of swear word: Whereas earlier
Inkscape versions would export to a file called foo.png.tmp, newer
behaviour is to ignore the user's wishes & write to foo.png.png –
unless one asks it to write to a filename with a .png extension,
Inkscape 1.0 changes the filename extension to .png each time.

As we do not know the extension of "${3}", we have to use the
extension, then rename the resulting file to the proper name;
only that way the export works with Inkscape 1.0 & earlier …
2021-08-27 03:08:04 +02:00
Nils Dagsson Moskopp a2b8489c80
Add Mineclonia menu icon PNG 2021-08-24 03:32:10 +02:00
Nils Dagsson Moskopp c83278d3ff
Add dofile for Mineclonia menu icon PNG 2021-08-24 03:31:58 +02:00
Nils Dagsson Moskopp cef3669ee2
Add Mineclonia menu icon SVG 2021-08-24 01:52:55 +02:00
cora 78634d4c90 Merge pull request 'PLAYER/wieldview: Fix server crash by client leaving after joining' (#138) from fix-server-crash-by-client-leaving-after-joining into master
Reviewed-on: Mineclonia/Mineclonia#138
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-08-22 17:26:32 +00:00
Nils Dagsson Moskopp 10ce37d887
Fix server crash by client leaving after joining
When a player joins and immediately leaves the game before a function is
called by minetest.after() in mods/PLAYER/wieldview/init.lua, it gets an
invalidated player object. This results in the player methods returning
nil (since Minetest 5.2); perhaps surprisingly, the player is not nil.

Not checking that the result of player:get_pos() is not nil could lead
to a server crash if a client crashed when joining. It has been reported
that a syntax error in a client side mod was enough to trigger that.
2021-08-22 04:21:35 +02:00
cora 3cd4ad5591 Merge pull request 'ENTITIES/mcl_item_entity: Fix non-serializable item entity unload crash' (#132) from fix-overlong-meta-item-crash-2 into master
Reviewed-on: Mineclonia/Mineclonia#132
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-08-01 01:23:43 +00:00
Nils Dagsson Moskopp ce6d6c26cc
Add debug command to acquire a written book
The “getwrittenbook” command gives a player that has the “debug” privilege a book
with a configurable amount of characters. This was added as a debug aid, to help
reproducing situations in which items with lots of metadata trigger issues like
heavy lag or server crashes.
2021-07-30 17:22:33 +02:00
Nils Dagsson Moskopp a0c9f11af6
Log warning for non-serializable item entity fix 2021-07-30 17:15:13 +02:00
sfan5 62d5b547a0
Fix non-serializable item entity unload crash
Some items, like shulkers or books, can have so much metadata that the
corresponding item entity can not be serialized by the Minetest engine.

Without this patch, dropping such an item and then moving away crashes
Minetest, as it can not serialize the entity with serializeString16()
when unloading a map block.

The patch resets the overlong metadata of non-serializable item entities.
This avoids a crash and makes it possible to retrieve a “sanitized” item
without metadata when the mapblock containing the item entity is reloaded.

Originally sfan5 guessed the maximum possible item entity serialization size
that would not lead to a crash as 65530 bytes, but anon5 calculated it to be
actually 65487 bytes. This has been experimentally verified by erlehmann.
2021-07-30 17:13:26 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 45cdad7283 Merge pull request 'MAPGEN/tsm_railcorridors: Generate pig spawners in mineshafts' (#127) from mineshaft-pig-spawners into master
Reviewed-on: Mineclonia/Mineclonia#127
Reviewed-by: E <e@noreply.git.minetest.land>
2021-07-23 02:24:17 +00:00
Nils Dagsson Moskopp 71cff7051f
Generate pig spawners in mineshafts
In Minecraft Java Edition, when the map generator generates a spawner,
it can generates a pig spawner instead of the spawner it should create.
That behaviour is very rare, but has never been removed from Minecraft.

This patch changes 1 in 1000 spawners in a mineshaft to be a pig spawner
instead of a cave spider spawner.
2021-07-23 04:11:33 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. eddbfb4b5c Merge pull request 'HUD/hudbars: Do not send useless HUDCHANGE packets' (#122) from fix-hudchange-spam into master
Reviewed-on: Mineclonia/Mineclonia#122
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-07-22 01:21:22 +00:00
Wuzzy 280aed484c
Do not send useless HUDCHANGE packets
Several mods set or unset the visibility of a HUD bar way too often (e.g.
in a globalstep handler), causing the server to send a lot of superfluous
HUDCHANGE packets to each client. Returning from hb.hide_hudbar() early
if HUD bar visibility would not change prevents sending these packets.
2021-07-21 10:28:04 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. c1cf50ae15 Merge pull request 'Add script to show packets count from client logs' (#123) from analyze-packet-spam into master
Reviewed-on: Mineclonia/Mineclonia#123
Reviewed-by: E <e@noreply.git.minetest.land>
2021-07-21 07:16:34 +00:00
Nils Dagsson Moskopp 01c8339f40
Add script to show packets count from debug logs
Mineclonia has inherited mods from MineClone 2 that send a lot of network
packets. This behaviour wastes bandwith and is most likely a major reason
for the unusually high amount of lag that MineClone2 and Mineclonia have.

Many network packets that are sent by Mineclonia are entirely useless.
Analyzing minetest log files to figure out what kind of packets are
sent and how often is a first step in getting rid of useless traffic.
2021-07-19 22:29:07 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 6219e8ae12 Merge pull request 'ITEMS/mcl_end: Make dragon egg teleport on punching' (#119) from dragon-egg-teleport into master
Reviewed-on: Mineclonia/Mineclonia#119
Reviewed-by: E <e@noreply.git.minetest.land>
2021-07-13 08:02:12 +00:00
Lizzy Fleckenstein 920ca96764
Make dragon egg teleport on punching 2021-07-13 09:11:48 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. e2e08f28dd Merge pull request 'items/mcl_bows: Let players shoot themselves with arrows' (#117) from fix-arrow-selfshoot-3 into master
Reviewed-on: Mineclonia/Mineclonia#117
Reviewed-by: E <e@noreply.git.minetest.land>
2021-07-13 06:55:57 +00:00
Nils Dagsson Moskopp 76e3a00e18
Make potion arrows able to hit end crystals 2021-07-12 22:21:15 +02:00
Nils Dagsson Moskopp 2033a9bf1d
Refactor potion arrow flight time calculation 2021-07-12 16:07:20 +02:00
Nils Dagsson Moskopp 99ebf08873
Refactor regular arrow flight time calculation 2021-07-12 16:06:44 +02:00
Nils Dagsson Moskopp c45c0df118
Play no hit sound when potion arrow hits shooter 2021-07-12 04:59:53 +02:00
Nils Dagsson Moskopp 39023f1adf
Play no hit sound when regular arrow hits shooter 2021-07-12 04:59:39 +02:00
Nils Dagsson Moskopp 689054f904
Fix sound_play invocation when player hit by potion arrow 2021-07-12 03:49:05 +02:00
cora 8ed5fd4740
Let players shoot themselves with potion arrows 2021-07-12 02:44:17 +02:00
epCode 6951ecdfc9
Let players shoot themselves with regular arrows 2021-07-12 02:09:47 +02:00
cora 9f086a9242 Merge pull request 'PLAYER/mcl_sprint: Send FOV packets only when necessary' (#106) from reduce-fov-packet-spam into master
Reviewed-on: Mineclonia/Mineclonia#106
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-07-06 20:35:12 +00:00
Nils Dagsson Moskopp 275f0826ed
Send FOV packets only when necessary
Before this change, about 10 to 30 FOV packets were sent from the server
to each connected client each second. This patch only sends FOV packets
when the FOV actually needs to be changed, i.e. when the player starts
or stops sprinting.
2021-07-04 03:25:05 +02:00
cora 00ee2d5013 Merge pull request 'ITEMS/mcl_chests: Fix Ender chests from MineClone2' (#103) from fix-ender-chests-from-mineclone2 into master
Reviewed-on: Mineclonia/Mineclonia#103
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-29 21:25:37 +00:00
Nils Dagsson Moskopp f8c58262bc
Fix Ender chests from MineClone2
Commit 819dbc6224 of MineClone2 introduced
an LBM that removed Ender chest formspecs stored in the node meta. That
change makes Ender chests that were loaded in MineClone2 versions past
that commit not show the Ender chest inventory form on right-click.

This patch makes those broken Ender chests work by introducing an LBM
that writes the formspec to the node meta for Ender chest nodes once.

Since the LBM name is suffixed with a hash of the Ender chest formspec,
changes to the Ender chest formspec (even removing it entirely) should
not require manual adjustment of the LBM code.
2021-06-28 22:54:00 +02:00
cora 926d5e2c37 Merge pull request 'mcl_inventory: Remove _mcl_autogroup dependency from mcl_inventory' (#76) from fix_inventory_depends into master
Reviewed-on: Mineclonia/Mineclonia#76
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-25 15:25:45 +00:00
cora f1ac39eaad Merge branch 'master' into fix_inventory_depends 2021-06-25 15:12:05 +00:00
cora 58fe08332f Merge pull request 'ITEMS/mcl_core: Fix snow dupe' (#102) from fix-snow-dupe into master
Reviewed-on: Mineclonia/Mineclonia#102
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-24 21:46:04 +00:00
Nils Dagsson Moskopp 1e42c37895
Reduce snow layer silk touch drop amount
It was possible to duplicate snow layers by placing them and then mining
them using a tool enchanted with silk touch. This commit fixes the “snow
dupe” by reducing the amount of snow layers dropped in this case by one.
2021-06-23 03:06:24 +02:00
cora 0816ee38b4 Merge pull request 'ITEMS/screwdriver: Show screwdriver in creative inventory' (#99) from show-screwdriver-in-creative-inventory into master
Reviewed-on: Mineclonia/Mineclonia#99
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-21 22:43:59 +00:00
Nils Dagsson Moskopp 0b92dc1f26
Show screwdriver in creative inventory 2021-06-22 00:16:57 +02:00
cora 87761bf454 Merge pull request 'Make fully grown beetroot drop 1 to 4 seeds when harvested' (#96) from fix-beetroot-seed-drops into master
Reviewed-on: Mineclonia/Mineclonia#96
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-20 22:13:45 +00:00
Elias Åström 725bf517ca Merge remote-tracking branch 'n_to/bow_increase_critical_chance_to_25'
Reviewed-on: #34
Reviewed-by: Elias Åström <ryvnf@riseup.net>
Reviewed-by: E <e@noreply.git.minetest.land>
2021-06-20 23:55:44 +02:00
Elias Åström fc61c71df5 Merge remote-tracking branch 'n_to/nametag_death_german'
Reviewed-on: #32
Reviewed-by: Li0n <li0nsdichachu@outlook.com>
Reviewed-by: Elias Åström <ryvnf@riseup.net>
2021-06-20 23:54:18 +02:00
Elias Åström 7bfd28cd75 Merge remote-tracking branch 'n_to/update_template.txt'
Reviewed-on: #17
Reviewed-by: Lion <li0nsdichachu@outlook.com>
2021-06-20 23:52:15 +02:00
Nils Dagsson Moskopp eb7b99d59e
Make fully grown beetroot drop 1 to 4 seeds when harvested
As beetroot often did not drop seeds, players could end up with no seeds when
trying to farm beetroot. This patch guarantees that at least one beetroot seed
is dropped when harvesting beetroot.
2021-06-20 19:02:35 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. b96dad7852 Merge pull request 'ITEMS/mcl_banners: Allow more layers for banners with gradients' (#74) from e/Mineclonia:banner-gradient-limits into master
Reviewed-on: Mineclonia/Mineclonia#74
Reviewed-by: Elias Åström <ryvnf@riseup.net>
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-06-19 13:01:11 +00:00
E 2feab24dd3 Allow more layers for banners with gradients
At some point in the past, Minetest had a bug that caused rendering
issues with transparent textures, like those used for banner gradients.
As a workaround, the number of allowed layers was reduced for banners
containing gradients. The engine bug has since been fixed, but the limit
was never removed.

This commit removes the limit.

See also: Mineclonia/Mineclonia#72 (comment)
and https://github.com/minetest/minetest/issues/6210
2021-06-19 01:43:36 -04:00
cora c9a8ef0ac2 Merge pull request 'ITEMS/REDSTONE/mcl_dispensers: Fix server crash when dispensing an unknown item' (#93) from fix-dispenser-unknown-item-crash into master
Reviewed-on: Mineclonia/Mineclonia#93
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-19 01:32:26 +00:00
Nils Dagsson Moskopp 2aafb2f2d0
Fix server crash when dispensing an unknown item 2021-06-19 02:04:59 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 86c1f37296 Merge pull request 'ENTITIES/mcl_boats: Fix server crash when boat passenger sneaks' (#91) from fix-boat-passenger-sneaking-crash into master
Reviewed-on: Mineclonia/Mineclonia#91
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-18 22:01:35 +00:00
Lizzy Fleckenstein 764ff5512a
Fix server crash when boat passenger sneaks
The crash occured when a player who is not a driver of a boat sneaked.
2021-06-18 19:08:19 +02:00
cora 6c311d5528 Merge pull request 'CORE/_mcl_autogroup: Prevent server crash on digging unknown' (#85) from fix-dig-unknown-crash into master
Reviewed-on: Mineclonia/Mineclonia#85
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-06-17 21:51:55 +00:00
cora 79766bff23
Fix server crash when players dig unknown nodes
Digging unknown nodes crashes the Clamity Minetest server, which
runs modified Minetest: https://github.com/ClamityAnarchy/minetest
Crashes did occur with commit d5434bf008 of that Minetest version.

This commit makes unknown nodes explicitly not harvestable.
2021-06-17 23:39:13 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 031ae5fcb5 Merge pull request 'ITEMS/mcl_jukebox: backport mcl_jukebox API' (#83) from backport_mcl_jukebox_api into master
Reviewed-on: Mineclonia/Mineclonia#83
Reviewed-by: Elias Åström <ryvnf@riseup.net>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-06-16 07:10:18 +00:00
Nils Dagsson Moskopp 7ccdbc5905
Document that music_record group, if it exists, is always 1 2021-06-15 23:22:45 +02:00
Nils Dagsson Moskopp 5f0710a486
Make jukebox accept and play old music records
With the introduction of the mcl_jukebox API, all music record items
were given new names. Old music record items were aliased, but never
worked with the jukebox. Apparently no one tested existing records.

By explicitly looking up the item name in minetest.registered_aliases,
the jukebox accepts old records, plays them, and gives out new records.
2021-06-15 17:46:03 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 811b6d7058 Merge branch 'master' into backport_mcl_jukebox_api 2021-06-14 22:03:28 +00:00
AFCMS e858ea6233
Add backward compatibility for mcl_jukeboxes 2021-06-14 23:42:25 +02:00
AFCMS 20b7b6ff99
Add API documentation for mcl_jukeboxe 2021-06-14 23:40:24 +02:00
AFCMS b6fc888559
Add API for mcl_jukebox 2021-06-14 23:35:30 +02:00
Elias Åström ab389e9995 Merge pull request 'tools: set up luacheck' (#57) from e/Mineclonia:luacheck-setup into master
Reviewed-on: Mineclonia/Mineclonia#57
Reviewed-by: Elias Åström <ryvnf@riseup.net>
2021-06-14 21:31:23 +00:00
E e14265ff8e luacheck: remove luacheck generator, generate rules in .luacheckrc 2021-05-29 18:45:22 -04:00
E b1fbbfdd35 tools: remove inline scripting from make-luacheck-files
- the awk script was moved to its own file (deps-to-luacheck.awk) with
  minor changes, including added commentary, slightly more rigorous error
  checking, and using a different separator model to avoid a second
  stage to remove trailing commas
- SED_MODCONF2DEPS was moved to a containing function, and commented
- the awk command itself is now easier on the eyes
2021-05-29 18:45:22 -04:00
E 02a8496b5f luacheck: include a generated luacheck config 2021-05-29 18:45:22 -04:00
E 0c13293f43 tools: add a luacheckrc generator
tools/make-luacheck-files.sh will generate a .luacheckrc with the
following rules:
 - any rules set in the project header (.luacheck.head)
 - each mod is allowed to use a single global sharing its mod name
 - mod dependency information is parsed, and those mods' globals are
   permitted for read access
2021-05-29 18:45:22 -04:00
cora 3ee2ef0618 Merge pull request 'mesecons: Do not crash server if world border is depowered' (#79) from fix-issue-78 into master
Reviewed-on: Mineclonia/Mineclonia#79
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-05-29 22:29:52 +00:00
Nils Dagsson Moskopp 27828b6317 Do not crash server if world border is depowered 2021-05-28 19:23:36 +02:00
Elias Åström 4b4d40f158 Use register_on_mods_loaded in mcl_inventory
This removes the need to include _mcl_autogroup as a dependency for
mcl_inventory (which should be avoided) and decreases the likelihood
that the code used for populating item tables is executed before all
other mods are loaded.
2021-05-23 20:35:10 +02:00
Elias Åström fac4a38657 Merge pull request 'Move data from deprecated files to mod.conf' (#67) from mod.conf into master
Reviewed-on: Mineclonia/Mineclonia#67
Reviewed-by: E <e@noreply.git.minetest.land>
2021-05-23 16:16:34 +00:00
Elias Åström c1bed0a826 Merge branch 'master' into mod.conf 2021-05-23 16:15:56 +00:00
E c17d450fda Merge pull request 'project: add issue & PR templates' (#56) from e/Mineclonia:issue-template into master
Reviewed-on: Mineclonia/Mineclonia#56
Reviewed-by: Elias Åström <ryvnf@riseup.net>
2021-05-19 00:49:10 +00:00
E 538e3b7e35 project: drop unhelpful fields from bug-report template
Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E 42205639f6 project: make the headers *actually* level 5
Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E dd8bcaec50 project: un-bold bug-report environment fields
Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E 4dd1b00a0a project: ask for definitive sources for Minecraft feature requests 2021-05-18 20:41:14 -04:00
E 32c7fe4741 project: change headings to level 5
Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E c9c568847c project: change wording of problem section in feature request template
Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E 838bf0034f project: simplify Feature Request template
Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E 7f9ad443ac project: simplify Environment section for issue templates 2021-05-18 20:41:14 -04:00
E 1738d57a2c project: add title instructions to PR template 2021-05-18 20:41:14 -04:00
E 438e91d212 project: remove [unknown] tag from issue templates
Reporters aren't expected to know the layout of the mods, and having the
tag in the title may be confusing.

Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E 9875183a6f project: add optional To do list to PR template
Mineclonia/Mineclonia#56 (comment)
2021-05-18 20:41:14 -04:00
E 95af8196a2 project: add issue & PR templates 2021-05-18 20:41:14 -04:00
Elias Åström f3b0285347 Merge pull request 'mcl_explosions: Adjust explosion entity damage hitbox' (#62) from mcl_explosions2 into master
Reviewed-on: Mineclonia/Mineclonia#62
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-05-18 18:16:39 +02:00
Elias Åström 4c61fc80c6 Merge pull request 'mcl_explosions: Fix rays for node destruction not being cast in (+X, +Y, +Z) direction from explosion' (#50) from mcl_explosions into master
Reviewed-on: Mineclonia/Mineclonia#50
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-05-18 16:07:09 +00:00
Elias Åström 7ea25ab172 Merge branch 'master' into mcl_explosions 2021-05-18 16:04:40 +00:00
Elias Åström 5d3514880a Move data from deprecated files to mod.conf
Move data from deprecated files (depends.txt and description.txt) into
fields in mod.conf for all mods.
2021-05-16 13:44:04 +02:00
Elias Åström d9bbf4879c Adjust explosion entity damage hitbox
In mcl_explosions the hitbox used for calculating the damage of an
entity is its collisionbox multiplied by two.  This commit removes the
multiplication by two because that makes explosion damage behave weirdly
in some circumstances.  It was most likely implemented that way because
of a misinterpretation of the Minecraft wiki.
2021-05-09 14:41:05 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. a9d4a85e9a Merge pull request 'Remove wrong preview banner crafting recipes' (#55) from banner-crafting-fix into master
Reviewed-on: Mineclonia/Mineclonia#55
Reviewed-by: E <e@noreply.git.minetest.land>
2021-05-03 14:30:47 +00:00
Nils Dagsson Moskopp ee9f49b86e
Remove wrong preview banner crafting recipes
In commit ac5f115f83, preview banners were introduced and given
crafting recipes. Those crafting recipes were the same as for banners without a pattern. That
change made banners without patterns uncraftable and preview banners craftable instead – this
patch makes banners without patterns craftable again and preview banners uncraftable.
2021-05-02 13:01:00 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 150868f03b Merge pull request 'mapgen/mcl_mapgen_core: base mushrooms and nether decorations off block seed' (#43) from e/Mineclonia:mapgen-nondet into master
Reviewed-on: Mineclonia/Mineclonia#43
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
Reviewed-by: Elias Åström <ryvnf@riseup.net>
2021-05-01 23:41:12 +00:00
Elias Åström 90f0a6ab2a Merge pull request 'Rewrite mcl_autogroup to reduce metadata for enchanted items' (#8) from mcl_autogroup into master
Reviewed-on: Mineclonia/Mineclonia#8
Reviewed-by: cora <cora@noreply.git.minetest.land>
Reviewed-by: n_to <n_to@noreply.git.minetest.land>
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-05-01 21:14:49 +00:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 659a158c66 Merge branch 'master' into mcl_autogroup 2021-05-01 18:02:18 +00:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 4085d95d96 Merge pull request 'Show preview of new banner pattern when crafting it' (#40) from banners-pattern-preview into master
Reviewed-on: Mineclonia/Mineclonia#40
Reviewed-by: cora <cora@noreply.git.minetest.land>
2021-05-01 17:25:19 +00:00
Elias Åström 74d4986d1d Fix rays not being cast in a specific direction
A bug was introduced in 679e2b1b which caused explosions to not cast
rays for environment destruction in the (+X, +Y, +Z) direction.  This
commit fixes that.
2021-05-01 17:25:10 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 3009ebb2c6 Merge branch 'master' into mcl_autogroup 2021-04-29 21:24:32 +00:00
Benjamin Schötz 9f61cfffaa mcl_bows: Cleanup translation files with script
Reordered translation-strings
Duplicates were removed
Gaps were detected for spanish and filled with machine-translation
2021-04-26 12:09:19 +02:00
Benjamin Schötz 7d44596c6d mcl_bows: Increase chance for critical from 20% to 25%
bow.lua Increase chance from 20% to 25%
bow.lua Adjust helptexts
arrow.lua Adjust helptexts
mcl_bows.(de,es,fr,ru).tr template.txt: Adjust helptexts
2021-04-26 11:11:18 +02:00
E 4ae17b0c8e mapgen/mcl_mapgen_core: base mushrooms and nether decorations off block seed 2021-04-25 23:17:27 -04:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 0d92212e08 Merge pull request 'mapgen/mcl_mapgen_core: move set_node decorations a node callback' (#29) from e/Mineclonia:nether-fix into master
Reviewed-on: Mineclonia/Mineclonia#29
Reviewed-by: Elias Åström <ryvnf@riseup.net>
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-04-24 18:51:57 +00:00
Benjamin Schötz 48091cecab mcl_enchanting: Add missing translation strings for enchantment table to template.txt and german, french, russian translations. 2021-04-24 09:06:56 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. d6463fe29a Merge pull request 'Fix crash when blowing up an unknown node' (#38) from mcl_explosions into master
Reviewed-on: Mineclonia/Mineclonia#38
Reviewed-by: n_to <n_to@noreply.git.minetest.land>
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-04-24 03:29:09 +00:00
Nils Dagsson Moskopp ac5f115f83
Show preview of new banner pattern when crafting it 2021-04-23 17:29:43 +02:00
Elias Åström 31341ca57b Fix crash when blowing up an unknown node
Unknown nodes get a blast resistance of zero.
2021-04-23 16:39:02 +02:00
Elias Åström e52cae28cd Duplicate groupcaps before applying unbreaking 2021-04-23 16:33:22 +02:00
Elias Åström aa1af725f2 Merge pull request 'Update README.md after forking' (#3) from readme into master
Reviewed-on: Mineclonia/Mineclonia#3
Reviewed-by: Li0n <li0nsdichachu@outlook.com>
2021-04-22 15:18:01 +00:00
Benjamin Schötz adbb2f037a Adds string for '@1 was slain by @2' (deathmessage for mob with nametag) to template.txt and mcl_death_messages.de.tr 2021-04-20 22:19:35 +02:00
E 2381cb8e84 mapgen/mcl_mapgen_core: move set_node decorations a node callback
During the rewrite in 89e55e9065, a queue system was added to allow
using both VoxelManip-based generation steps, and set_node-based steps,
however some set_node-based steps (underground mushrooms, nether
decorations, and structures) were missed and remained in a VoxelManip
step. The result is that the changes made by the set_node stages were
overwritten after the (now-stale) VoxelManip data was committed later.

(ref. Mineclonia/Mineclonia#26)
2021-04-20 00:41:10 -04:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. fda2d41b4e Merge pull request 'Spawns killerbunnys with translateable nametag' (#28) from n_to/Mineclonia:killerbunny_translateable_label into master
Reviewed-on: Mineclonia/Mineclonia#28
Reviewed-by: cora <cora@noreply.git.minetest.land>
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-04-20 02:56:32 +00:00
Benjamin Schötz e5c324b0d7 Added french, spanish, russian translation for killerbunny-nametag 2021-04-19 20:43:18 +02:00
Benjamin Schötz 82c838e067 Sets killerbunny-label in a translateable way 2021-04-19 20:27:20 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. bbe07abb0d Merge pull request 'Solve quartz not generating in the nether' (#24) from reintroduce_nether_quartz_ore into master
Reviewed-on: Mineclonia/Mineclonia#24
2021-04-18 23:12:17 +00:00
AFCMS 078586fa1a
Solve quartz not generating in the nether 2021-04-19 00:14:35 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. 0761ad0964 Merge pull request 'Make the server not crash when players are killed by named mobs' (#19) from fix_server_crash_when_player_killed_by_named_mob into master
Reviewed-on: Mineclonia/Mineclonia#19
2021-04-18 15:46:20 +00:00
Nils Dagsson Moskopp c0a76dd24f
Make the server not crash when players are killed by named mobs 2021-04-18 16:51:47 +02:00
Elias Åström 1c6d3c2fea Do not include unnecessary tool_capabilities
This commit makes enchanted tools which have no use for
tool_capabilities to not include it in their metadata.  It does this by
not including tool_capabilities in the metadata of an enchanted tool if
at least one of two cases is true:

(1) The tool is not enchanted with unbreaking or efficiency
(2) The tool does not have tool_capabilities defined in its definition

The first case covers situations like having a pickaxe only being
enchanted with silk_touch.  The second case covers situations like a
piece of armor being enchanted with unbreaking.
2021-04-18 12:45:11 +02:00
Elias Åström d6e1fe42d1 Fix efficiency and unbreaking not working together
This commit fixes an issue were tools enchanted with both efficiency and
unbreaking would loose the effect of one of the enchantments in some
conditions.
2021-04-18 12:45:06 +02:00
My favourite Minetest cheat clients are Dragonfire and Waspsaliva. b041666c18 Merge pull request 'Revert broken minecart change' (#4) from minecart into master
Reviewed-on: Mineclonia/Mineclonia#4

This code fixes annoying minecart bugs that were introduced with Mineclone2 0.71.0:

• Minecarts going off the rails (#9)
• Minecarts being unable to go back on the rails (#10)
• TNT minecarts being broken (#11)
• Minecarts not being pushed by mobs (#12)

I have verified that it does not break the following features present in Mineclone2 0.70:

• Minecart teleporters
• Minecarts stop at the end of the rail
• Going uphill in a minecart
• Going downhill in a minecart
• Going around curves in a minecart
• Going left at intersections in a minecart with both left and right rail connections
• Going straight ahead at intersections with both right and straight ahead rail connections
• Pushing minecarts
• Powered golden rails make minecarts go faster
• Unpowered golden rails make minecarts stop
• Detector rails activate Redstone circuits
• Minecarts going in circles at maximum speed without glitching off the rails
• Dispensers placing minecarts on top of rail blocks on top of the dispenser
• Going to the Nether in a minecart
• Powered activator rails drop players from minecarts
• Unpowered activator rails do not drop players from minecarts
• Track switching using pistons pushing a Minecart from one track to another
• Minecarts stay on powered rails going up a spiral staircase
• Minecarts can activate note blocks through sensor blocks
• Minecarts can activate Redstone lamps through sensor blocks
2021-04-18 03:29:36 +00:00
Elias Åström 357024ad97 Merge pull request 'Update name in game.conf to Mineclonia' (#2) from game.conf into master
Reviewed-on: Mineclonia/Mineclonia#2
Reviewed-by: erlehmann <nils+git.minetest.land@dieweltistgarnichtso.net>
2021-04-16 22:15:34 +00:00
Elias Åström 42c7186674 Do not register "creative_breakable" as a diggroup 2021-04-16 22:46:08 +02:00
Elias Åström b57c94df88 Fix crash when digging nodes with fishing rod
Previously the game would crash when digging nodes with a tool which
does not have tool_capabilities in their item definition.
2021-04-16 22:45:36 +02:00
Elias Åström 34af6a2cc3 Assert that both parts of mcl_autogroup exist 2021-04-16 22:45:22 +02:00
Elias Åström 029ebaa388 Rename "tool_multiplier" to "speed" for tools 2021-04-16 22:45:22 +02:00
Elias Åström 2df6ee32be Remove unnecessary code in mcl_item_entity 2021-04-16 22:45:22 +02:00
Elias Åström 9d38f0d01b Fix crash when digging nodes with hoe
Previously the game would crash when digging nodes with a tool which
does not have _mcl_digroups in their item definition.
2021-04-16 22:44:44 +02:00
Elias Åström eb1af8902d Remove _mcl_autogroup depends on mcl_autogroup
It looks like the dependency might cause problems with the mod loading
order and lead to situations were _mcl_autogroup is not loaded after all
the other mods.  Because _mcl_autogroup begins with an underscore it
should always be loaded after mcl_autogroup anyways.
2021-04-16 22:35:46 +02:00
Elias Åström d4a3213343 Update README.txt in _mcl_autogroup 2021-04-16 22:35:24 +02:00
Elias Åström 0681fc98d2 Use mod.conf for mcl_autogroup and _mcl_autogroup 2021-04-16 22:35:12 +02:00
Elias Åström 9c961394ec Automatically assign nodes to creative_breakable
If they belong to any digging group.
2021-04-16 22:34:53 +02:00
Elias Åström 64e8b82ff7 Update the groupcaps of all enchanted tools
Not just those enchanted with efficiency.
2021-04-16 22:34:48 +02:00
Elias Åström 54563262f6 Make tools without toolcaps do damage as hand
If the tool_capabilities defaults to {} if unspecified the tool, then
users will not be able to attack with the tool at all.  This solves that
by including the damage_group and full_punch_interval from the hand into
the tool_capabilities when it is nil.
2021-04-16 22:34:44 +02:00
Elias Åström 6fb56b074f Fix crash when tool_capabilities is nil 2021-04-16 22:34:34 +02:00
Elias Åström 7583223f68 Localize variables in _mcl_autogroup 2021-04-16 22:34:30 +02:00
Elias Åström 9bb39dfba6 Rename _mcl_autogroup_groupcaps to _mcl_diggroups 2021-04-16 22:34:26 +02:00
Elias Åström dcd050a274 Fix typo 2021-04-16 22:34:22 +02:00
Elias Åström ccd53e7f10 Force tools to include levels in their diggroups 2021-04-16 22:34:18 +02:00
Elias Åström 85ff4cee75 Improve documentation of mcl_autogroup 2021-04-16 22:34:14 +02:00
Elias Åström 3308ce812d Move mcl_util.hash to a local function
It is probably unlikely it will be useful at other places in Mineclone2.
2021-04-16 22:34:10 +02:00
Elias Åström e32f17b82a Move efficiency code to its own file 2021-04-16 22:34:04 +02:00
Elias Åström 576dde1dd5 Truncate groupcaps_hash to 8 Base64 digits 2021-04-16 22:33:59 +02:00
Elias Åström b50addac55 Make changes to the mcl_autogroup API
Group levels are now specified as a list of names when registering a
digging group.  Digging groups which do not have specified levels will
support tools having two levels, 0 and 1 where 0 means the tool can dig
but not harvest the node and 1 means it can also harvest the node.  If
more levels are required one has to specifiy them when registering the
digging group.
2021-04-16 22:33:55 +02:00
Elias Åström fe883a40bc Use hashing for more efficient groupcaps updating
This adds the metadata field "groupcaps_hash" to tools enchanted with
efficiency.  This value contains a hash of the groupcaps field in
tool_capabilities.  This value gets compared to the expected hash value
to determine if the tools tool_capabilities should be updated according
to commit af31f8189e8e5c2b.

This commit makes efficiency more efficient.
2021-04-16 22:33:13 +02:00
Elias Åström 4a9561e5dc Update enchanted tools with outdated digging times
Because of the way digging times is implemented in Mineclone2, it is
possible for the digging times of efficiency enchanted tools to become
outdated.

This fixes that by automatically updating the tools tool_capabilities
after each time the tool is used.
2021-04-16 22:33:10 +02:00
Elias Åström c92f0e5ce3 Fix tools not taking wear when rightclicking
Added the API function mcl_autogroup.get_wear which is used to get the
tool wear for digging a node of a group.  This is used by mcl_tools to
compute the wear of shovels and shears when rightclicking to create
grass paths and carve pumpkins.
2021-04-16 22:33:07 +02:00
Elias Åström ba0a09243b Make mcl_enchanting use the new mcl_autogroups
The function mcl_autogroups.get_groupcaps is used by mods to get the
groupcaps for tools with efficiency enchantments.  This function is used
by mcl_enchanting when enchanting tools with efficiency.
2021-04-16 22:33:00 +02:00
Elias Åström 64e353a9c2 Fix some nodes not being diggable
Previously some nodes like "mcl_flowers:double_grass_top" would be
undiggable.  This was because they did not define _mcl_hardness and it
was not defaulted to 0 in all parts of _mcl_autogroup.
2021-04-16 22:32:56 +02:00
Elias Åström ecccc2058a Fix tool uses not being set in _mcl_autogroups 2021-04-16 22:32:53 +02:00
Elias Åström bb5094f657 Rename register_digtime_group to register_diggroup 2021-04-16 22:32:49 +02:00
Elias Åström a342652960 Change comments for mcl_autogroup 2021-04-16 22:32:46 +02:00
Elias Åström ffbbe91bc5 Remove mcl_autogroups.get_groupcaps
Requiring tool definitions to call a function in _mcl_autogroup means
that they need to be loaded after _mcl_autogroup.  This can cause
problems because _mcl_autogroup needs to be loaded after all tool and
node definitions are completed.

Because of this the API is changed so tool definitions instead put the
data used to generate groupcaps in the custom field
_mcl_autogroup_groupcaps.  _mcl_autogroup will then go through all
registered tools and update the groupcaps for every tool where this
field is present.  This means that no mod ever has to depend on
_mcl_autogroup.
2021-04-16 22:31:57 +02:00
Elias Åström 012e150b59 Rewrite mcl_autogroup
These changes are primarly made to make mcl_autogroup more efficient.
Previously enchanted tools required storing around 21 kB of metadata due
to the way the previous version of the mod was implemented.  This caused
a lot of lag and a huge amount of network traffic.  With the changes
enchanted tools won't require more than 1 kB of metadata.

The mod is also rewritten to use an API to register digging groups and
compute the groupcaps for tools.  This will make it easier for modders
to register custom digging groups.

The mod is now split up into two parts.  One part called "mcl_autogroup"
to implement the API for registering custom digging groups, and the
other part called "_mcl_autogroup" which contains most of the code which
has to be loaded after most mods.
2021-04-16 22:31:42 +02:00
Elias Åström 6741aded0b Update name in game.conf to Mineclonia 2021-04-16 16:34:59 +02:00
Elias Åström 15df697836 Update supported Minetest version to 5.4.0 2021-04-16 16:34:08 +02:00
Elias Åström b6b0496a26 Update README.md after forking 2021-04-16 16:34:08 +02:00
Elias Åström ac20baac12 Revert "Slightly tweak minecarts to be more MC-like"
This reverts commit 8af76f835d.
2021-04-16 16:29:06 +02:00
420 changed files with 12096 additions and 1626 deletions

View File

@ -0,0 +1,38 @@
---
name: "Bug Report"
about: "Use this for when something's broken."
labels:
- bug
- unconfirmed
---
##### What happened?
<!-- Describe what's wrong. -->
##### What did I expect?
<!-- Describe what should be happening instead -->
##### How to get it to happen
<!--
Write down exactly what you did to get the bug to happen
If you need more steps, just keep adding numbers. If you
don't need them all, delete the empty numbers.
-->
1.
2.
3.
##### Environment
Mineclonia Version: <!-- Paste the version of Mineclonia here, if you know it. -->
<!--
Please refer to https://git.minetest.land/Mineclonia/Mineclonia/wiki/Reporting-Bugs
if you need help finding your Minetest version.
-->
Minetest Version:

View File

@ -0,0 +1,22 @@
---
name: "Feature Request"
about: "Mineclonia doesn't do something you need it to"
labels:
- "feature request"
---
##### Problem
<!--
Describe what's wrong.
If you're reporting a missing feature from Minecraft,
please include a link to the Minetest wiki or Mojang bug
tracker entry describing that feature.
-->
##### Solution
<!-- Write down an example of what you'd like to happen. -->

View File

@ -0,0 +1,51 @@
<!--
Please include the main mod this PR affects in the title, including
the leading directory. For example, if you have added a new
type of banner to mcl_banners, the title should look like:
items/mcl_banners: add new banner type
-->
##### Problem
TRACKING ISSUE: #<!-- Tracking issue number -->
<!--
Describe WHAT problem this pull request solves.
If the tracking issue includes all the needed
information, you can leave this section empty.
-->
##### Solution
<!-- Describe HOW this pull request solves its problem. -->
##### Details
<!-- Include any additional information here. -->
##### Testing Steps
<!--
Write how we can verify this patch addresses its problem.
If you need more steps, just keep adding numbers. If you
don't need them all, delete the empty numbers.
-->
1.
2.
3.
<!--
If your pull request still needs work, uncomment the
following section and include a list of things that
need to be done before it's ready for us to look at.
Please remember to put WIP: in front of the title as well.
-->
<!--
##### To do
- [ ] Item 1
- [ ] Item 2
- [ ] Item 3
-->

102
.luacheckrc Normal file
View File

@ -0,0 +1,102 @@
std = "min"
read_globals = {
"ItemStack",
"dump", "dump2",
"vector",
"VoxelArea",
"minetest",
"PseudoRandom",
"PerlinNoise",
"PcgRandom",
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn", "indexof", "insert_all"}},
math = {fields = {"hypot", "round"}},
}
-- A config option to allow r/w access to mods which contain
-- this one. It only avoids a couple warnings, and may not be
-- the behavior we want, so it's disabled by default.
local allow_parents=false
local lfs = require "lfs"
-- Seed the queue with the mods/ directory
local queue={ {"mods"} }
local function check(dir)
-- Get the string of the directory path
local sdir=table.concat(dir, "/")
-- Save the top-level directory name as a
-- fallback in case there's no mod.conf,
-- or no name= directive.
local name=dir[#dir]
-- Is there a mod.conf?
if lfs.attributes(sdir.."/mod.conf", "mode") == "file" then
local deps={}
for line in io.lines(sdir.."/mod.conf") do
-- Use name= if it's there
name=string.match(line, "name *= *([a-zA-Z0-9_]+)") or name
-- Get the dependency entries (if they're there)
local ents=string.match(line, "depends *=(.*)$")
if ents then
-- Split them in to the comma-separated names
for m in string.gmatch(ents, "([a-zA-Z0-9_]+),?") do
table.insert(deps, m)
end
end
end
local glb={ name }
if allow_parents then
for _, v in pairs(dir) do
-- Skip ALL-CAPS names since those tend
-- to be collections of mods instead of
-- mods themselves.
if not string.match(v, "^[A-Z]+$") then
table.insert(glb, v)
end
end
end
-- Tell Luacheck what the directory is allowed to do
files[sdir]={
globals = glb,
read_globals = deps,
}
elseif lfs.attributes(sdir.."/init.lua", "mode") == "file" then
-- No mod.conf, but there's an init.lua here.
local glb={ name }
if allow_parents then
for _, v in pairs(dir) do
-- Again, skip ALL-CAPS.
if not string.match(v, "^[A-Z]+$") then
table.insert(glb, v)
end
end
end
files[sdir]={ globals=glb }
end
-- Queue any child directories
for d in lfs.dir(sdir) do
-- Skip hidden directories and parent/current directories.
if lfs.attributes(sdir.."/"..d, "mode") == "directory" and not string.match(d, "^%.") then
-- Copy dir in to nd (New Dir)
local nd={}
for k, v in pairs(dir) do
nd[k]=v
end
nd[#nd+1]=d
table.insert(queue, nd)
end
end
end
while #queue > 0 do
-- Pop an entry and process it.
check(table.remove(queue, 1))
end

4
API.md
View File

@ -17,6 +17,10 @@ Items can have these fields:
anvil.
See `mcl_banners` for an example.
Tools can have these fields:
* `_mcl_diggroups`: Specifies the digging groups that a tool can dig and how
efficiently. See `_mcl_autogroup` for more information.
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

View File

@ -21,7 +21,7 @@ The basic digging time groups determine by which tools a node can be dug.
* `swordy=1`: Diggable by sword (any material), and this node is *not* a cobweb
* `swordy_cobweb=1`: Diggable by sword (any material), and this node is a cobweb
* `shearsy=1`: Diggable by shears, and this node is *not* wool
* `shearsy=wool=1`: Diggable by shears, and this node is wool
* `shearsy_wool=1`: Diggable by shears, and this node is wool
* `handy=1`: Breakable by hand and this node gives it useful drop when dug by hand. All nodes which are breakable by pickaxe, axe, shovel, sword or shears are also automatically breakable by hand, but not neccess
* `creative_breakable=1`: Block is breakable by hand in creative mode. This group is implied if the node belongs to any other digging group
@ -149,7 +149,7 @@ These groups are used mostly for informational purposes
* `trapdoor=2`: Open trapdoor
* `glass=1`: Glass (full cubes only)
* `rail=1`: Rail
* `music_record`: Music Disc (rating is track ID)
* `music_record=1`: Music Disc
* `tnt=1`: Block is TNT
* `boat=1`: Boat
* `minecart=1`: Minecart
@ -182,6 +182,10 @@ These groups are used mostly for informational purposes
* `redstone_torch=1`: Redstone Torch (lit)
* `redstone_torch=2`: Redstone Torch (unlit)
* `dirt=1`: Uncovered dirt
* `dirt=2`: Covered dirt (grass or mycelium or podzol on top)
* `dirt=3`: Coarse dirt
* `plant=1`: Plant or part of a plant
* `double_plant`: Part of a double-sized plant. 1 = lower part, 2 = upper part

View File

@ -1,5 +1,5 @@
# MineClone 2
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
# Mineclonia
An unofficial Minecraft-like game for Minetest. Forked from MineClone2.
Developed by many people. Not developed or endorsed by Mojang AB.
Version: 0.71.0
@ -74,24 +74,24 @@ These items do not work yet, but you can get them with `/giveme` for testing:
* Minecart with Command Block: `mcl_minecarts:command_block_minecart`
## Installation
This game requires [Minetest](http://minetest.net) to run (version 5.0.0 or
This game requires [Minetest](http://minetest.net) to run (version 5.4.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.
There is no support for running Mineclonia in development versions of Minetest.
To install MineClone 2 (if you haven't already), move this directory into the
To install Mineclonia (if you haven't already), move this directory into the
“games” directory of your Minetest data directory. Consult the help of
Minetest to learn more.
## Project description
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
The main goal of **Mineclonia** is to be a clone of Minecraft and to be released as free software.
* **Target of development: Minecraft, PC Edition, version 1.12** (later known as “Java Edition”)
* MineClone2 also includes Optifine features supported by the Minetest
* Mineclonia also includes Optifine features supported by the Minetest
* Features of later Minecraft versions might sneak in, but they have a low priority
* In general, Minecraft is aimed to be cloned as good as Minetest currently permits (no hacks)
* Cloning the gameplay has highest priority
* MineClone 2 will use different graphics and sounds, but with a similar style
* Mineclonia will use different graphics and sounds, but with a similar style
* Cloning the interface has no priority. It will only be roughly imitated
* Limitations found in Minetest will be written down and reported in the course of development
@ -178,18 +178,18 @@ Technical differences from Minecraft:
* Different sounds (various sources)
* Different engine (Minetest)
… and finally, MineClone 2 is free software (“free” as in “freedom”)!
… and finally, Mineclonia is free software (“free” as in “freedom”)!
## Reporting bugs
Please report all bugs and missing Minecraft features here:
<https://git.minetest.land/MineClone2/MineClone2/issues>
<https://git.minetest.land/Mineclonia/Mineclonia/issues>
## Other readme files
* `LICENSE.txt`: The GPLv3 license text
* `CONTRIBUTING.md`: Information for those who want to contribute
* `MISSING_ENGINE_FEATURES.md`: List of missing features in Minetest which MineClone 2 would need for improvement
* `MISSING_ENGINE_FEATURES.md`: List of missing features in Minetest which Mineclonia would need for improvement
* `API.md`: For Minetest modders who want to mod this game
## Credits
@ -197,15 +197,15 @@ 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 (retired)
* davedevils: Creator of MineClone on which MineClone 2 is based on
* davedevils: Creator of MineClone on which Mineclonia 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
* MysticTempest: Bugfixes
* [bzoss](https://github.com/bzoss): Status effects, potions, brewing stand
* kay27 <kay27@bk.ru>: Experience system, bugfixes, optimizations (Current maintainer)
* [EliasFleckenstein03](https://github.com/EliasFleckenstein03): End crystals, enchanting, burning mobs / players, animated chests, bugfixes (Current maintainer)
* kay27 <kay27@bk.ru>: Experience system, bugfixes, optimizations
* [EliasFleckenstein03](https://github.com/EliasFleckenstein03): End crystals, enchanting, burning mobs / players, animated chests, bugfixes
* epCode: Better player animations, new logo
* 2mac: Fix bug with powered rail
* Lots of other people: TO BE WRITTEN (see mod directories for details)
@ -255,7 +255,7 @@ Various sources. See the respective mod directories for details.
* davedevils for starting MineClone, the original version of this game
* Wuzzy for starting and maintaining MineClone2 for several years
* celeron55 for creating Minetest
* Minetest's modding community for providing a huge selection of mods, some of which ended up in MineClone 2
* Minetest's modding community for providing a huge selection of mods, some of which ended up in Mineclonia
* Jordach for the jukebox music compilation from Big Freaking Dig
* The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game
* Notch and Jeb for being the major forces behind Minecraft
@ -273,10 +273,9 @@ Copying is an act of love. Please copy and share! <3
Here's the detailed legalese for those who need it:
### License of source code
MineClone 2 (by kay27, EliasFleckenstein, Wuzzy, davedevils and countless others)
is an imitation of Minecraft.
Mineclonia is an imitation of Minecraft.
MineClone 2 is free software: you can redistribute it and/or modify
Mineclonia is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -290,15 +289,15 @@ details.
In the mods you might find in the read-me or license
text files a different license. This counts as dual-licensing.
You can choose which license applies to you: Either the
license of MineClone 2 (GNU GPLv3) or the mod's license.
license of Mineclonia (GNU GPLv3) or the mod's license.
MineClone 2 is a direct continuation of the discontinued MineClone
project by davedevils.
Mineclonia is a continuation of the discontinued MineClone project by davedevils
and the MineClone2 project by Wuzzy.
Mod credits:
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.
of Mineclonia and the author is Wuzzy.
### License of media (textures and sounds)
No non-free licenses are used anywhere.

View File

@ -1,2 +1,2 @@
name = MineClone 2
name = Mineclonia
description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

29
menu/icon.png.do Normal file
View File

@ -0,0 +1,29 @@
#!/bin/sh
set -eu
SVG_FILE=${2%.png}.svg
# How crisp a Minetest menu icon appears is influenced by image height
# and width. Low resolutions lead to blurry edges, as Minetest scales
# menu icons up. High resolutions lead to jagged edges, as Minetest
# scales menu icons down. Height & width of 72 pixes seem to work.
#
# Though usually one would export directly to "${3}", Inkscape 1.0 had
# its command line options changed by people who apparently think that
# backwards compatibility is some kind of swear word: Whereas earlier
# Inkscape versions would export to a file called foo.png.tmp, newer
# behaviour is to ignore the user's wishes & write to foo.png.png
# unless one asks it to write to a filename with a .png extension,
# Inkscape 1.0 changes the filename extension to .png each time.
#
# As we do not know the extension of "${3}", we have to use the
# extension, then rename the resulting file to the proper name;
# only that way the export works with Inkscape 1.0 & earlier …
>&2 inkscape \
--file="${SVG_FILE}" \
--export-png="${3}".png \
--export-area-page \
--export-height 72 \
--export-width 72 \
mv "${3}".png "${3}"

8838
menu/icon.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 509 KiB

View File

@ -4,6 +4,11 @@ Specifically, this mod has 2 purposes:
1) Automatically adding the group “solid” for blocks considered “solid” in Minecraft.
2) Generating digging time group for all nodes based on node metadata (it's complicated)
This mod also requires another mod called “mcl_autogroup” to function properly.
“mcl_autogroup” exposes the API used to register digging groups, while this mod
uses those digging groups to set the digging time groups for all the nodes and
tools.
See init.lua for more infos.
The leading underscore in the name “_mcl_autogroup” was added to force Minetest to load this mod as late as possible.

View File

@ -1 +0,0 @@
MineClone 2 core mod which automatically adds groups to all items. Very important for digging times.

View File

@ -1,169 +1,365 @@
--[[ Mining times. Yeah, mining times … Alright, this is going to be FUN!
--[[
This mod implements a HACK to make 100% sure the digging times of all tools
match Minecraft's perfectly. The digging times system of Minetest is very
different, so this weird group trickery has to be used. In Minecraft, each
block has a hardness and the actual Minecraft digging time is determined by
this:
This mod does include a HACK to make 100% sure the digging times of all tools match Minecraft's perfectly.
The digging times system of Minetest is very different, so this weird group trickery has to be used.
In Minecraft, each block has a hardness and the actual Minecraft digging time is determined by this:
1) The block's hardness
2) The tool being used
3) Whether the tool is considered as eligible for the block
2) The tool being used (the tool speed and its efficiency level)
3) Whether the tool is considered as "eligible" for the block
(e.g. only diamond pick eligible for obsidian)
See Minecraft Wiki <http://minecraft.gamepedia.com/Minecraft_Wiki> for more information.
In MineClone 2, all diggable node have the hardness set in the custom field _mcl_hardness (0 by default).
The nodes are also required to specify the eligible tools in groups like pickaxey, shovely, etc.
This mod then calculates the real digging time based on the node meta data. The real digging times
are then added into mcl_autogroup.digtimes where the table indices are group rating and the values are the
digging times in seconds. These digging times can be then added verbatim into the tool definitions.
See Minecraft Wiki <http://minecraft.gamepedia.com/Minecraft_Wiki> for more
information.
Example:
mcl_autogroup.digtimes.pickaxey_dig_diamond[1] = 0.2
How the mod is used
===================
This means that when a node has been assigned the group pickaxey_dig_diamond=1, it can be dug by the
diamond pickaxe in 0.2 seconds.
In MineClone 2, all diggable nodes have the hardness set in the custom field
"_mcl_hardness" (0 by default). These values are used together with digging
groups by this mod to create the correct digging times for nodes. Digging
groups are registered using the following code:
mcl_autogroup.register_diggroup("shovely")
mcl_autogroup.register_diggroup("pickaxey", {
levels = { "wood", "gold", "stone", "iron", "diamond" }
})
The first line registers a simple digging group. The second line registers a
digging group with 5 different levels (in this case one for each material of a
pickaxes).
This strange setup with mcl_autogroup has been done to minimize the amount of required digging times
a single tool needs to use. If this is not being done, the loading time will increase considerably
(>10s).
Nodes indicate that they belong to a particular digging group by being member of
the digging group in their node definition. "mcl_core:dirt" for example has
shovely=1 in its groups. If the digging group has multiple levels the value of
the group indicates which digging level the node requires.
"mcl_core:stone_with_gold" for example has pickaxey=4 because it requires a
pickaxe of level 4 be mined.
]]
For tools to be able to dig nodes of digging groups they need to use the have
the custom field "_mcl_diggroups" function to get the groupcaps. The value of
this field is a table which defines which groups the tool can dig and how
efficiently.
local materials = { "wood", "gold", "stone", "iron", "diamond" }
local basegroups = { "pickaxey", "axey", "shovely" }
local minigroups = { "handy", "shearsy", "swordy", "shearsy_wool", "swordy_cobweb" }
local divisors = {
["wood"] = 2,
["gold"] = 12,
["stone"] = 4,
["iron"] = 6,
["diamond"] = 8,
["handy"] = 1,
["shearsy"] = 15,
["swordy"] = 1.5,
["shearsy_wool"] = 5,
["swordy_cobweb"] = 15,
}
local max_efficiency_level = 5
_mcl_diggroups = {
handy = { speed = 1, level = 1, uses = 0 },
pickaxey = { speed = 1, level = 0, uses = 0 },
}
mcl_autogroup = {}
mcl_autogroup.digtimes = {}
mcl_autogroup.creativetimes = {} -- Copy of digtimes, except that all values are 0. Used for creative mode
The "uses" field indicate how many uses (0 for infinite) a tool has when used on
the specified digging group. The "speed" field is a multiplier to the dig speed
on that digging group.
for m=1, #materials do
for g=1, #basegroups do
mcl_autogroup.digtimes[basegroups[g].."_dig_"..materials[m]] = {}
mcl_autogroup.creativetimes[basegroups[g].."_dig_"..materials[m]] = {}
for e=1, max_efficiency_level do
mcl_autogroup.digtimes[basegroups[g].."_dig_"..materials[m].."_efficiency_"..e] = {}
The "level" field indicates which levels of the group the tool can harvest. A
level of 0 means that the tool cannot harvest blocks of that node. A level of 1
or above means that the tool can harvest nodes with that level or below. See
"mcl_tools/init.lua" for examples on how "_mcl_diggroups" is used in practice.
Information about the mod
=========================
The mod is split up into two parts, mcl_autogroup and _mcl_autogroup.
mcl_autogroup contains the API functions used to register custom digging groups.
_mcl_autogroup contains most of the code. The leading underscore in the name
"_mcl_autogroup" is used to force Minetest to load that part of the mod as late
as possible. Minetest loads mods in reverse alphabetical order.
This also means that it is very important that no mod adds _mcl_autogroup as a
dependency.
--]]
assert(minetest.get_modpath("mcl_autogroup"), "This mod requires the mod mcl_autogroup to function")
-- Returns a table containing the unique "_mcl_hardness" for nodes belonging to
-- each diggroup.
local function get_hardness_values_for_groups()
local maps = {}
local values = {}
for g, _ in pairs(mcl_autogroup.registered_diggroups) do
maps[g] = {}
values[g] = {}
end
for _, ndef in pairs(minetest.registered_nodes) do
for g, _ in pairs(mcl_autogroup.registered_diggroups) do
if ndef.groups[g] ~= nil then
maps[g][ndef._mcl_hardness or 0] = true
end
end
end
for g, map in pairs(maps) do
for k, _ in pairs(map) do
table.insert(values[g], k)
end
end
for g, _ in pairs(mcl_autogroup.registered_diggroups) do
table.sort(values[g])
end
return values
end
-- Returns a table containing a table indexed by "_mcl_hardness_value" to get
-- its index in the list of unique hardnesses for each diggroup.
local function get_hardness_lookup_for_groups(hardness_values)
local map = {}
for g, values in pairs(hardness_values) do
map[g] = {}
for k, v in pairs(values) do
map[g][v] = k
end
end
return map
end
-- Array of unique hardness values for each group which affects dig time.
local hardness_values = get_hardness_values_for_groups()
-- Map indexed by hardness values which return the index of that value in
-- hardness_value. Used for quick lookup.
local hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
local function compute_creativetimes(group)
local creativetimes = {}
for index, hardness in pairs(hardness_values[group]) do
table.insert(creativetimes, 0)
end
return creativetimes
end
-- Get the list of digging times for using a specific tool on a specific
-- diggroup.
--
-- Parameters:
-- group - the group which it is digging
-- can_harvest - if the tool can harvest the block
-- speed - dig speed multiplier for tool (default 1)
-- efficiency - efficiency level for the tool if applicable
local function get_digtimes(group, can_harvest, speed, efficiency)
local speed = speed or 1
if efficiency then
speed = speed + efficiency * efficiency + 1
end
local digtimes = {}
for index, hardness in pairs(hardness_values[group]) do
local digtime = (hardness or 0) / speed
if can_harvest then
digtime = digtime * 1.5
else
digtime = digtime * 5
end
if digtime <= 0.05 then
digtime = 0
else
digtime = math.ceil(digtime * 20) / 20
end
table.insert(digtimes, digtime)
end
return digtimes
end
-- Get one groupcap field for using a specific tool on a specific group.
local function get_groupcap(group, can_harvest, multiplier, efficiency, uses)
return {
times = get_digtimes(group, can_harvest, multiplier, efficiency),
uses = uses,
maxlevel = 0,
}
end
-- Add the groupcaps from a field in "_mcl_diggroups" to the groupcaps of a
-- tool.
local function add_groupcaps(toolname, groupcaps, groupcaps_def, efficiency)
if not groupcaps_def then
return
end
for g, capsdef in pairs(groupcaps_def) do
local mult = capsdef.speed or 1
local uses = capsdef.uses
local def = mcl_autogroup.registered_diggroups[g]
local max_level = def.levels and #def.levels or 1
assert(capsdef.level, toolname .. ' is missing level for ' .. g)
local level = math.min(capsdef.level, max_level)
if def.levels then
groupcaps[g .. "_dig_default"] = get_groupcap(g, false, mult, efficiency, uses)
if level > 0 then
groupcaps[g .. "_dig_" .. def.levels[level]] = get_groupcap(g, true, mult, efficiency, uses)
end
else
groupcaps[g .. "_dig"] = get_groupcap(g, level > 0, mult, efficiency, uses)
end
end
end
for g=1, #minigroups do
mcl_autogroup.digtimes[minigroups[g].."_dig"] = {}
mcl_autogroup.creativetimes[minigroups[g].."_dig"] = {}
for e=1, max_efficiency_level do
mcl_autogroup.digtimes[minigroups[g].."_dig_efficiency_"..e] = {}
mcl_autogroup.creativetimes[minigroups[g].."_dig_efficiency_"..e] = {}
-- Checks if the given node would drop its useful drop if dug by a given tool.
-- Returns true if it will yield its useful drop, false otherwise.
function mcl_autogroup.can_harvest(nodename, toolname)
local ndef = minetest.registered_nodes[nodename]
if not ndef then
return false
end
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
return true
end
-- Check if it can be dug by tool
local tdef = minetest.registered_tools[toolname]
if tdef and tdef._mcl_diggroups then
for g, gdef in pairs(tdef._mcl_diggroups) do
if ndef.groups[g] then
if ndef.groups[g] <= gdef.level then
return true
end
end
end
end
-- Check if it can be dug by hand
local tdef = minetest.registered_tools[""]
if tdef then
for g, gdef in pairs(tdef._mcl_diggroups) do
if ndef.groups[g] then
if ndef.groups[g] <= gdef.level then
return true
end
end
end
end
return false
end
-- Get one groupcap field for using a specific tool on a specific group.
local function get_groupcap(group, can_harvest, multiplier, efficiency, uses)
return {
times = get_digtimes(group, can_harvest, multiplier, efficiency),
uses = uses,
maxlevel = 0,
}
end
-- Returns the tool_capabilities from a tool definition or a default set of
-- tool_capabilities
local function get_tool_capabilities(tdef)
if tdef.tool_capabilities then
return tdef.tool_capabilities
end
-- If the damage group and punch interval from hand is not included,
-- then the user will not be able to attack with the tool.
local hand_toolcaps = minetest.registered_tools[""].tool_capabilities
return {
full_punch_interval = hand_toolcaps.full_punch_interval,
damage_groups = hand_toolcaps.damage_groups
}
end
-- Get the groupcaps for a tool. This function returns "groupcaps" table of
-- digging which should be put in the "tool_capabilities" of the tool definition
-- or in the metadata of an enchanted tool.
--
-- Parameters:
-- toolname - Name of the tool being enchanted (like "mcl_tools:diamond_pickaxe")
-- efficiency - The efficiency level the tool is enchanted with (default 0)
--
-- NOTE:
-- This function can only be called after mod initialization. Otherwise a mod
-- would have to add _mcl_autogroup as a dependency which would break the mod
-- loading order.
function mcl_autogroup.get_groupcaps(toolname, efficiency)
local tdef = minetest.registered_tools[toolname]
local groupcaps = table.copy(get_tool_capabilities(tdef).groupcaps or {})
add_groupcaps(toolname, groupcaps, tdef._mcl_diggroups, efficiency)
return groupcaps
end
-- Get the wear from using a tool on a digging group.
--
-- Parameters
-- toolname - Name of the tool used
-- diggroup - The name of the diggroup the tool is used on
--
-- NOTE:
-- This function can only be called after mod initialization. Otherwise a mod
-- would have to add _mcl_autogroup as a dependency which would break the mod
-- loading order.
function mcl_autogroup.get_wear(toolname, diggroup)
local tdef = minetest.registered_tools[toolname]
local uses = tdef._mcl_diggroups[diggroup].uses
return math.ceil(65535 / uses)
end
local overwrite = function()
for nname, ndef in pairs(minetest.registered_nodes) do
local groups_changed = false
local newgroups = table.copy(ndef.groups)
if (nname ~= "ignore" and ndef.diggable) then
-- Automatically assign the “solid” group for solid nodes
-- Automatically assign the "solid" group for solid nodes
if (ndef.walkable == nil or ndef.walkable == true)
and (ndef.collision_box == nil or ndef.collision_box.type == "regular")
and (ndef.node_box == nil or ndef.node_box.type == "regular")
and (ndef.groups.not_solid == 0 or ndef.groups.not_solid == nil) then
newgroups.solid = 1
groups_changed = true
end
-- Automatically assign the “opaque” group for opaque nodes
-- Automatically assign the "opaque" group for opaque nodes
if (not (ndef.paramtype == "light" or ndef.sunlight_propagates)) and
(ndef.groups.not_opaque == 0 or ndef.groups.not_opaque == nil) then
newgroups.opaque = 1
groups_changed = true
end
local function calculate_group(hardness, material, diggroup, newgroups, actual_rating, expected_rating, efficiency)
local time, validity_factor
if actual_rating >= expected_rating then
-- Valid tool
validity_factor = 1.5
else
-- Wrong tool (higher digging time)
validity_factor = 5
end
local speed_multiplier = divisors[material]
if efficiency then
speed_multiplier = speed_multiplier + efficiency * efficiency + 1
end
time = (hardness * validity_factor) / speed_multiplier
if time <= 0.05 then
time = 0
else
time = math.ceil(time * 20) / 20
end
table.insert(mcl_autogroup.digtimes[diggroup], time)
if not efficiency then
table.insert(mcl_autogroup.creativetimes[diggroup], 0)
end
newgroups[diggroup] = #mcl_autogroup.digtimes[diggroup]
return newgroups
end
local creative_breakable = false
-- Hack in digging times
local hardness = ndef._mcl_hardness
if not hardness then
hardness = 0
end
-- Assign groups used for digging this node depending on
-- the registered digging groups
for g, gdef in pairs(mcl_autogroup.registered_diggroups) do
creative_breakable = true
local index = hardness_lookup[g][ndef._mcl_hardness or 0]
if ndef.groups[g] then
if gdef.levels then
newgroups[g .. "_dig_default"] = index
-- Handle pickaxey, axey and shovely
for _, basegroup in pairs(basegroups) do
if (hardness ~= -1 and ndef.groups[basegroup]) then
for g=1,#materials do
local diggroup = basegroup.."_dig_"..materials[g]
newgroups = calculate_group(hardness, materials[g], diggroup, newgroups, g, ndef.groups[basegroup])
for e=1,max_efficiency_level do
newgroups = calculate_group(hardness, materials[g], diggroup .. "_efficiency_" .. e, newgroups, g, ndef.groups[basegroup], e)
for i = ndef.groups[g], #gdef.levels do
newgroups[g .. "_dig_" .. gdef.levels[i]] = index
end
groups_changed = true
end
end
end
for m=1, #minigroups do
local minigroup = minigroups[m]
if hardness ~= -1 then
local diggroup = minigroup.."_dig"
-- actual rating
local ar = ndef.groups[minigroup]
if ar == nil then
ar = 0
end
if (minigroup == "handy")
or
(ndef.groups.shearsy_wool and minigroup == "shearsy_wool" and ndef.groups.wool)
or
(ndef.groups.swordy_cobweb and minigroup == "swordy_cobweb" and nname == "mcl_core:cobweb")
or
(ndef.groups[minigroup] and minigroup ~= "swordy_cobweb" and minigroup ~= "shearsy_wool") then
newgroups = calculate_group(hardness, minigroup, diggroup, newgroups, ar, 1)
for e=1,max_efficiency_level do
newgroups = calculate_group(hardness, minigroup, diggroup .. "_efficiency_" .. e, newgroups, ar, 1, e)
end
groups_changed = true
else
newgroups[g .. "_dig"] = index
end
end
end
if groups_changed then
minetest.override_item(nname, {
groups = newgroups
})
end
-- Automatically assign the node to the
-- creative_breakable group if it belongs to any digging
-- group.
newgroups["creative_breakable"] = 1
minetest.override_item(nname, {
groups = newgroups
})
end
end
for tname, tdef in pairs(minetest.registered_tools) do
-- Assign groupcaps for digging the registered digging groups
-- depending on the _mcl_diggroups in the tool definition
if tdef._mcl_diggroups then
local toolcaps = table.copy(get_tool_capabilities(tdef))
toolcaps.groupcaps = mcl_autogroup.get_groupcaps(tname)
minetest.override_item(tname, {
tool_capabilities = toolcaps
})
end
end
end

View File

@ -1 +1,3 @@
name = _mcl_autogroup
author = ryvnf
description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times.

View File

@ -1 +0,0 @@
Adds additional ways for nodes to be attached.

View File

@ -0,0 +1,2 @@
name = mcl_attached
description = Adds additional ways for nodes to be attached.

View File

@ -0,0 +1,28 @@
--[[
This is one part of a mod to replicate the digging times from Minecraft. This
part only exposes a function to register digging groups. The rest of the mod is
implemented and documented in the _mcl_autogroup.
The mod is split up into two parts, mcl_autogroup and _mcl_autogroup.
mcl_autogroup contains the API functions used to register custom digging groups.
_mcl_autogroup contains most of the code. The leading underscore in the name
"_mcl_autogroup" is used to force Minetest to load that part of the mod as late
as possible. Minetest loads mods in reverse alphabetical order.
--]]
mcl_autogroup = {}
mcl_autogroup.registered_diggroups = {}
assert(minetest.get_modpath("_mcl_autogroup"), "This mod requires the mod _mcl_autogroup to function")
-- Register a group as a digging group.
--
-- Parameters:
-- group - Name of the group to register as a digging group
-- def - Table with information about the diggroup (defaults to {} if unspecified)
--
-- Values in def:
-- level - If specified it is an array containing the names of the different
-- digging levels the digging group supports.
function mcl_autogroup.register_diggroup(group, def)
mcl_autogroup.registered_diggroups[group] = def or {}
end

View File

@ -0,0 +1,3 @@
name = mcl_autogroup
author = ryvnf
description = MineClone 2 core mod which automatically adds groups to all items. Very important for digging times.

View File

@ -0,0 +1,8 @@
# mcl_colors
Mod providing global table containing legacy minecraft colors to be used in mods.
## mcl_colors.*
Colors by upper name, in hex value.
## mcl_colors.background.*
Background colors by upper name, in hex value.

View File

@ -0,0 +1,36 @@
mcl_colors = {
BLACK = "#000000",
DARK_BLUE = "#0000AA",
DARK_GREEN = "#00AA00",
DARK_AQUA = "#00AAAA",
DARK_RED = "#AA0000",
DARK_PURPLE = "#AA00AA",
GOLD = "#FFAA00",
GRAY = "#AAAAAA",
DARK_GRAY = "#555555",
BLUE = "#5555FF",
GREEN = "#55FF55",
AQUA = "#55FFFF",
RED = "#FF5555",
LIGHT_PURPLE = "#FF55FF",
YELLOW = "#FFFF55",
WHITE = "#FFFFFF",
background = {
BLACK = "#000000",
DARK_BLUE = "#00002A",
DARK_GREEN = "#002A00",
DARK_AQUA = "#002A2A",
DARK_RED = "#2A0000",
DARK_PURPLE = "#2A002A",
GOLD = "#2A2A00",
GRAY = "#2A2A2A",
DARK_GRAY = "#151515",
BLUE = "#15153F",
GREEN = "#153F15",
AQUA = "#153F3F",
RED = "#3F1515",
LIGHT_PURPLE = "#3F153F",
YELLOW = "#3F3F15",
WHITE = "#373501",
}
}

View File

@ -0,0 +1,3 @@
name = mcl_colors
author = Fleckenstein
description = The HTML sequences for the minecraft colors

View File

@ -57,46 +57,44 @@ local function compute_sphere_rays(radius)
local rays = {}
local sphere = {}
for i=1, 2 do
local function add_ray(pos)
sphere[minetest.hash_node_position(pos)] = pos
end
for y = -radius, radius do
for z = -radius, radius do
for x = -radius, 0 do
local d = x * x + y * y + z * z
if d <= radius * radius then
add_ray(vector.new(x, y, z))
add_ray(vector.new(-x, y, z))
break
end
end
end
end
for x = -radius, radius do
for z = -radius, radius do
for y = -radius, 0 do
local d = x * x + y * y + z * z
if d <= radius * radius then
add_ray(vector.new(x, y, z))
add_ray(vector.new(x, -y, z))
break
end
end
end
end
for x = -radius, radius 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
for z = -radius, 0 do
local d = x * x + y * y + z * z
if d <= radius * radius then
add_ray(vector.new(x, y, z))
add_ray(vector.new(x, y, -z))
break
end
end
end
@ -202,7 +200,10 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher)
npos_x - emin_x + 1
local cid = data[idx]
local br = node_blastres[cid]
-- Set blast resistance to 0 for unknown nodes
local br = node_blastres[cid] or 0
if br < INDESTRUCT_BLASTRES and br > max_blast_resistance then
br = max_blast_resistance
end
@ -250,12 +251,12 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher)
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 x1 = collisionbox[1]
local y1 = collisionbox[2]
local z1 = collisionbox[3]
local x2 = collisionbox[4]
local y2 = collisionbox[5]
local z2 = collisionbox[6]
local x_len = math.abs(x2 - x1)
local y_len = math.abs(y2 - y1)
local z_len = math.abs(z2 - z1)

View File

@ -1 +0,0 @@
Initialization mod of MineClone 2. Defines some common shared variables and sets up initial default settings which have to be set at the beginning.

View File

@ -1 +1,2 @@
name = mcl_init
description = Initialization mod of MineClone 2. Defines some common shared variables and sets up initial default settings which have to be set at the beginning.

View File

@ -1 +0,0 @@
API for filling a chest with random treasures.

View File

@ -1 +1,2 @@
name = mcl_loot
description = API for filling a chest with random treasures.

View File

@ -1 +0,0 @@
Contains particle images of MineClone 2. No code.

View File

@ -1 +1,2 @@
name = mcl_particles
description = Contains particle images of MineClone 2. No code.

View File

@ -1 +0,0 @@
This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them.

View File

@ -1 +1,2 @@
name = mcl_sounds
description = This mod contains the core sounds of MineClone 2 as well as helper function for mods to access them.

View File

@ -1 +0,0 @@
mcl_init

View File

@ -1 +0,0 @@
Helper functions for MineClone 2.

View File

@ -1 +1,3 @@
name = mcl_util
description = Helper functions for MineClone 2.
depends = mcl_init

View File

@ -1 +0,0 @@
mcl_init

View File

@ -1 +0,0 @@
Utility functions for worlds and the “dimensions”.

View File

@ -0,0 +1,3 @@
name = mcl_worlds
description = Utility functions for worlds and the “dimensions”.
depends = mcl_init

View File

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

View File

@ -1 +0,0 @@
mcl_core

View File

@ -0,0 +1,2 @@
name = drippingwater
depends = mcl_core

View File

@ -1,3 +0,0 @@
mcl_player
mcl_core?
doc_identifier?

View File

@ -1 +0,0 @@
Adds drivable boats.

View File

@ -243,7 +243,7 @@ function boat.on_step(self, dtime, moveresult)
else
local ctrl = self._passenger:get_player_control()
if ctrl and ctrl.sneak then
detach_player(self._passenger, true)
detach_object(self._passenger, true)
self._passenger = nil
end
end
@ -260,7 +260,7 @@ function boat.on_step(self, dtime, moveresult)
return
end
local yaw = self.object:get_yaw()
if ctrl.up then
if ctrl and ctrl.up then
-- Forwards
self._v = self._v + 0.1 * v_factor
@ -269,7 +269,7 @@ function boat.on_step(self, dtime, moveresult)
self.object:set_animation({x=0, y=40}, paddling_speed, 0, true)
self._animation = 1
end
elseif ctrl.down then
elseif ctrl and ctrl.down then
-- Backwards
self._v = self._v - 0.1 * v_factor

View File

@ -1 +1,4 @@
name = mcl_boats
description = Adds drivable boats.
depends = mcl_player
optional_depends = mcl_core, doc_identifier

View File

@ -155,6 +155,16 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
}) + 1
end
local already_burning = mcl_burning.is_burning(obj)
mcl_burning.set(obj, "float", "burn_time", burn_time)
mcl_burning.set(obj, "string", "reason", reason)
if already_burning then
return
end
local hud_id
if obj:is_player() then
hud_id = mcl_burning.get(obj, "int", "hud_id")
@ -168,8 +178,7 @@ function mcl_burning.set_on_fire(obj, burn_time, reason)
}) + 1
end
end
mcl_burning.set(obj, "float", "burn_time", burn_time)
mcl_burning.set(obj, "string", "reason", reason)
mcl_burning.set(obj, "int", "hud_id", hud_id)
mcl_burning.set(obj, "int", "sound_id", sound_id)
@ -285,7 +294,7 @@ function mcl_burning.fire_entity_step(self, dtime)
end
local animation_timer = self.animation_timer + dtime
if animation_timer >= 0.015 then
if animation_timer >= ( 1 / mcl_burning.animation_fps ) then
animation_timer = 0
local animation_frame = self.animation_frame + 1
if animation_frame > mcl_burning.animation_frames - 1 then
@ -296,3 +305,48 @@ function mcl_burning.fire_entity_step(self, dtime)
end
self.animation_timer = animation_timer
end
minetest.register_chatcommand("burn", {
params = S("<playername> <duration> <reason>"),
description = S("Sets a player on fire for the given amount of seconds with the given reason."),
privs = { debug = true },
func = function(name, params)
local playername, duration, reason = params:match("^(.+) (.+) (.+)$")
if not (playername and duration and reason) then
return false, S("Error: Parameter missing.")
end
local player = minetest.get_player_by_name(playername)
if not player then
return false, S(
"Error: Player “@1” not found.",
playername
)
end
local duration_number = tonumber(duration)
-- Lua numbers are truthy
-- NaN is not equal to NaN
if not duration_number or (duration_number ~= duration_number) then
return false, S(
"Error: Duration “@1” is not a number.",
duration
)
end
if duration_number < 0 then
return false, S(
"Error: Duration “@1” is negative.",
duration
)
end
mcl_burning.set_on_fire(
player,
duration_number,
reason
)
return true, S(
"Set @1 on fire for @2s for the following reason: @3",
playername,
duration,
reason
)
end,
})

View File

@ -2,7 +2,8 @@ local S = minetest.get_translator("mcl_burning")
local modpath = minetest.get_modpath("mcl_burning")
mcl_burning = {
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8,
animation_fps = tonumber(minetest.settings:get("fire_animation_fps")) or 30
}
dofile(modpath .. "/api.lua")

View File

@ -1 +0,0 @@
Falling node entities, Minecraft-style

View File

@ -1 +1,2 @@
name = mcl_falling_nodes
description = Falling node entities, Minecraft-style

View File

@ -1,2 +0,0 @@
flowlib
mcl_enchanting

View File

@ -1 +0,0 @@
Dropped items will be attracted to the player like a magnet.

View File

@ -1,3 +1,4 @@
local S = minetest.get_translator("mcl_item_entity")
--basic settings
local item_drop_settings = {} --settings table
item_drop_settings.age = 1.0 --how old a dropped item (_insta_collect==false) has to be before collecting
@ -165,66 +166,6 @@ minetest.register_globalstep(function(dtime)
end
end)
local minigroups = { "shearsy", "swordy", "shearsy_wool", "swordy_cobweb" }
local basegroups = { "pickaxey", "axey", "shovely" }
local materials = { "wood", "gold", "stone", "iron", "diamond" }
-- Checks if the given node would drop its useful drop if dug by a tool
-- with the given tool capabilities. Returns true if it will yield its useful
-- drop, false otherwise.
local check_can_drop = function(node_name, tool_capabilities)
local handy = minetest.get_item_group(node_name, "handy")
local dig_immediate = minetest.get_item_group(node_name, "dig_immediate")
if handy == 1 or dig_immediate == 2 or dig_immediate == 3 then
return true
else
local toolgroupcaps
if tool_capabilities then
toolgroupcaps = tool_capabilities.groupcaps
else
return false
end
-- Compare node groups with tool capabilities
for m=1, #minigroups do
local minigroup = minigroups[m]
local g = minetest.get_item_group(node_name, minigroup)
if g ~= 0 then
local plus = minigroup .. "_dig"
if toolgroupcaps[plus] then
return true
end
for e=1,5 do
local effplus = plus .. "_efficiency_" .. e
if toolgroupcaps[effplus] then
return true
end
end
end
end
for b=1, #basegroups do
local basegroup = basegroups[b]
local g = minetest.get_item_group(node_name, basegroup)
if g ~= 0 then
for m=g, #materials do
local plus = basegroup .. "_dig_"..materials[m]
if toolgroupcaps[plus] then
return true
end
for e=1,5 do
local effplus = plus .. "_efficiency_" .. e
if toolgroupcaps[effplus] then
return true
end
end
end
end
end
return false
end
end
-- Stupid workaround to get drops from a drop table:
-- Create a temporary table in minetest.registered_nodes that contains the proper drops,
-- because unfortunately minetest.get_node_drops needs the drop table to be inside a registered node definition
@ -281,17 +222,20 @@ function minetest.handle_node_drops(pos, drops, digger)
-- Check if node will yield its useful drop by the digger's tool
local dug_node = minetest.get_node(pos)
local toolcaps
local tooldef
local tool
if digger ~= nil then
tool = digger:get_wielded_item()
toolcaps = tool:get_tool_capabilities()
tooldef = minetest.registered_tools[tool:get_name()]
if not check_can_drop(dug_node.name, toolcaps) then
if not mcl_autogroup.can_harvest(dug_node.name, tool:get_name()) then
return
end
end
local diggroups = tooldef and tooldef._mcl_diggroups
local shearsy_level = diggroups and diggroups.shearsy and diggroups.shearsy.level
--[[ Special node drops when dug by shears by reading _mcl_shears_drop or with a silk touch tool reading _mcl_silk_touch_drop
from the node definition.
Definition of _mcl_shears_drop / _mcl_silk_touch_drop:
@ -303,7 +247,7 @@ function minetest.handle_node_drops(pos, drops, digger)
local silk_touch_drop = false
local nodedef = minetest.registered_nodes[dug_node.name]
if toolcaps ~= nil and toolcaps.groupcaps and toolcaps.groupcaps.shearsy_dig and nodedef._mcl_shears_drop then
if shearsy_level and shearsy_level > 0 and nodedef._mcl_shears_drop then
if nodedef._mcl_shears_drop == true then
drops = { dug_node.name }
else
@ -505,7 +449,7 @@ minetest.register_entity(":__builtin:item", {
end,
get_staticdata = function(self)
return minetest.serialize({
local data = minetest.serialize({
itemstring = self.itemstring,
always_collect = self.always_collect,
age = self.age,
@ -513,6 +457,39 @@ minetest.register_entity(":__builtin:item", {
_flowing = self._flowing,
_removed = self._removed,
})
-- sfan5 guessed that the biggest serializable item
-- entity would have a size of 65530 bytes. This has
-- been experimentally verified to be still too large.
--
-- anon5 has calculated that the biggest serializable
-- item entity has a size of exactly 65487 bytes:
--
-- 1. serializeString16 can handle max. 65535 bytes.
-- 2. The following engine metadata is always saved:
-- • 1 byte (version)
-- • 2 byte (length prefix)
-- • 14 byte “__builtin:item”
-- • 4 byte (length prefix)
-- • 2 byte (health)
-- • 3 × 4 byte = 12 byte (position)
-- • 4 byte (yaw)
-- • 1 byte (version 2)
-- • 2 × 4 byte = 8 byte (pitch and roll)
-- 3. This leaves 65487 bytes for the serialization.
if #data > 65487 then -- would crash the engine
local stack = ItemStack(self.itemstring)
stack:get_meta():from_table(nil)
self.itemstring = stack:to_string()
minetest.log(
"warning",
"Overlong item entity metadata removed: “" ..
self.itemstring ..
"” had serialized length of " ..
#data
)
return self:get_staticdata()
end
return data
end,
on_activate = function(self, staticdata, dtime_s)
@ -805,3 +782,29 @@ minetest.register_entity(":__builtin:item", {
-- Note: on_punch intentionally left out. The player should *not* be able to collect items by punching
})
-- The “getwrittenbook” command was added as a debug aid. It can help
-- reproducing situations in which items with lots of metadata trigger
-- issues like heavy lag or server crashes. Do not remove this command
-- unless another easy way of getting items with overlong meta exists!
--
-- “/getwrittenbook 65323” creates an item that creates the largest
-- possible serializable written book item entity when dropped.
--
-- “/getwrittenbook 65324” creates an item that creates the smallest
-- possible non-serializable written book item entity when dropped.
minetest.register_chatcommand("getwrittenbook", {
params = S("<Count>"),
description = S("Get a written book with a configurable amount of characters."),
privs = {debug=true},
func = function(name, param)
local count = tonumber(param)
local itemstack = ItemStack("mcl_books:written_book")
local meta = itemstack:get_meta()
meta:set_string("description", "")
meta:set_string("text", string.rep("x", count))
local player = minetest.get_player_by_name(name)
local inv = player:get_inventory()
inv:add_item("main", itemstack)
end
})

View File

@ -1 +1,3 @@
name = mcl_item_entity
description = Dropped items will be attracted to the player like a magnet.
depends = flowlib, mcl_enchanting

View File

@ -1,12 +0,0 @@
mcl_explosions
mcl_core
mcl_sounds
mcl_player
mcl_achievements
mcl_chests
mcl_furnaces
mesecons_commandblock
mcl_hoppers
mcl_tnt
mesecons
doc_identifier?

View File

@ -1 +0,0 @@
Minecarts are vehicles to move players quickly on rails.

View File

@ -12,14 +12,15 @@ local function detach_driver(self)
if not self._driver then
return
end
if self._driver:is_player() then
mcl_player.player_attached[self._driver:get_player_name()] = nil
self._driver:set_detach()
self._driver:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
mcl_player.player_set_animation(self._driver, "stand" , 30)
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)
@ -61,7 +62,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
on_rightclick = on_rightclick,
_driver = nil, -- player (or mob) who sits in and controls the minecart (only for minecart!)
_driver = nil, -- player who sits in and controls the minecart (only for minecart!)
_punched = false, -- used to re-send _velocity and position
_velocity = {x=0, y=0, z=0}, -- only used on punch
_start_pos = nil, -- Used to calculate distance for “On A Rail” achievement
@ -96,101 +97,111 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
end
function cart:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
-- Punch: Pick up minecart (unless TNT was ignited)
if self._boomtimer then return end
if self._driver then
detach_driver(self)
end
local pos = self.object:get_pos()
-- Disable detector rail
local rou_pos = vector.round(pos)
local node = minetest.get_node(rou_pos)
if node.name == "mcl_minecarts:detector_rail_on" then
local newnode = {name="mcl_minecarts:detector_rail", param2 = node.param2}
minetest.swap_node(rou_pos, newnode)
mesecon.receptor_off(rou_pos)
if not self._railtype then
local node = minetest.get_node(vector.floor(pos)).name
self._railtype = minetest.get_item_group(node, "connect_to_raillike")
end
-- Drop items and remove cart entity
if not minetest.is_creative_enabled(puncher:get_player_name()) then
for d=1, #drop do
minetest.add_item(self.object:get_pos(), drop[d])
if not puncher or not puncher:is_player() then
local cart_dir = mcl_minecarts:get_rail_direction(pos, {x=1, y=0, z=0}, nil, nil, self._railtype)
if vector.equals(cart_dir, {x=0, y=0, z=0}) then
return
end
elseif puncher and puncher:is_player() then
local inv = puncher:get_inventory()
for d=1, #drop do
if not inv:contains_item("main", drop[d]) then
inv:add_item("main", drop[d])
self._velocity = vector.multiply(cart_dir, 3)
self._old_pos = nil
self._punched = true
return
end
-- Punch+sneak: Pick up minecart (unless TNT was ignited)
if puncher:get_player_control().sneak and not self._boomtimer then
if self._driver then
if self._old_pos then
self.object:set_pos(self._old_pos)
end
detach_driver(self)
end
-- Disable detector rail
local rou_pos = vector.round(pos)
local node = minetest.get_node(rou_pos)
if node.name == "mcl_minecarts:detector_rail_on" then
local newnode = {name="mcl_minecarts:detector_rail", param2 = node.param2}
minetest.swap_node(rou_pos, newnode)
mesecon.receptor_off(rou_pos)
end
-- Drop items and remove cart entity
if not minetest.is_creative_enabled(puncher:get_player_name()) then
for d=1, #drop do
minetest.add_item(self.object:get_pos(), drop[d])
end
elseif puncher and puncher:is_player() then
local inv = puncher:get_inventory()
for d=1, #drop do
if not inv:contains_item("main", drop[d]) then
inv:add_item("main", drop[d])
end
end
end
self.object:remove()
return
end
self.object:remove()
local vel = self.object:get_velocity()
if puncher:get_player_name() == self._driver then
if math.abs(vel.x + vel.z) > 7 then
return
end
end
local punch_dir = mcl_minecarts:velocity_to_dir(puncher:get_look_dir())
punch_dir.y = 0
local cart_dir = mcl_minecarts:get_rail_direction(pos, punch_dir, nil, nil, self._railtype)
if vector.equals(cart_dir, {x=0, y=0, z=0}) then
return
end
time_from_last_punch = math.min(time_from_last_punch, tool_capabilities.full_punch_interval)
local f = 3 * (time_from_last_punch / tool_capabilities.full_punch_interval)
self._velocity = vector.multiply(cart_dir, f)
self._old_pos = nil
self._punched = true
end
cart.on_activate_by_rail = on_activate_by_rail
function cart:on_step(dtime)
local ctrl, player = nil, nil
local update = {}
local vel = self.object:get_velocity()
local pos, rou_pos, node
pos = self.object:get_pos()
rou_pos = vector.round(pos)
node = minetest.get_node(rou_pos)
local g = minetest.get_item_group(node.name, "connect_to_raillike")
if self._driver and self._driver:is_player() then
player = self._driver
ctrl = player:get_player_control()
-- player detach
if ctrl.sneak then
detach_driver(self)
return
end
if g == self._railtype then
if ctrl.right then
local c = vector.multiply(minetest.yaw_to_dir(self._driver:get_look_horizontal()-1.57), 0.2)
self.object:set_velocity(vector.add(vel, {x=c.x, y=0, z=c.z}))
end
if ctrl.left then
local c = vector.multiply(minetest.yaw_to_dir(self._driver:get_look_horizontal()+1.57), 0.2)
self.object:set_velocity(vector.add(vel, {x=c.x, y=0, z=c.z}))
end
if ctrl.up then
local c = vector.multiply(self._driver:get_look_dir(), 0.2)
self.object:set_velocity(vector.add(vel, {x=c.x, y=0, z=c.z}))
end
if ctrl.down then
local c = vector.multiply(self._driver:get_look_dir(), 0.2)
self.object:set_velocity(vector.subtract(vel, {x=c.x, y=0, z=c.z}))
if self._driver then
player = minetest.get_player_by_name(self._driver)
if player then
ctrl = player:get_player_control()
-- player detach
if ctrl.sneak then
detach_driver(self)
return
end
end
end
local vel = self.object:get_velocity()
local update = {}
if self._last_float_check == nil then
self._last_float_check = 0
else
self._last_float_check = self._last_float_check + dtime
end
local pos, rou_pos, node
-- Drop minecart if it isn't on a rail anymore
if self._last_float_check >= mcl_minecarts.check_float_time then
for _,object in pairs(minetest.get_objects_inside_radius(pos, 1.3)) do
if object ~= self.object then
local mob = object:get_luaentity()
if mob then mob = mob._cmi_is_mob == true end
if mob and (not self._driver) and not object:get_attach() then
self._driver = object
object:set_attach(self.object, "", {x=0, y=-1.75, z=-2}, {x=0, y=0, z=0})
mobs:set_animation(self.object, "stand")
return
end
end
end
pos = self.object:get_pos()
rou_pos = vector.round(pos)
node = minetest.get_node(rou_pos)
local g = minetest.get_item_group(node.name, "connect_to_raillike")
if g ~= self._railtype and self._railtype ~= nil then
-- Detach driver
if player then
@ -289,12 +300,8 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
end
end
if update.vel then
if self._punched then
vel = vector.add(vel, self._velocity)
if vel.x>8 then vel.x = 8 end
if vel.x<-8 then vel.x = -8 end
if vel.z>8 then vel.z = 8 end
if vel.z<-8 then vel.z = -8 end
self.object:set_velocity(vel)
self._old_dir.y = 0
elseif vector.equals(vel, {x=0, y=0, z=0}) and (not has_fuel) then
@ -619,14 +626,17 @@ register_minecart(
"mcl_minecarts_minecart_normal.png",
{"mcl_minecarts:minecart"},
function(self, clicker)
if not clicker or not clicker:is_player() then return end
if clicker == self._driver then
local name = clicker:get_player_name()
if not clicker or not clicker:is_player() then
return
end
local player_name = clicker:get_player_name()
if self._driver and player_name == self._driver then
detach_driver(self)
else
local name = clicker:get_player_name()
self._driver = clicker
elseif not self._driver then
self._driver = player_name
self._start_pos = self.object:get_pos()
mcl_player.player_attached[name] = true
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})
mcl_player.player_attached[name] = true
minetest.after(0.2, function(name)
@ -637,7 +647,6 @@ register_minecart(
mcl_tmp_message.message(clicker, S("Sneak to dismount"))
end
end, name)
clicker:set_look_horizontal(self.object:get_yaw())
end
end, activate_normal_minecart
)

View File

@ -1 +1,4 @@
name = mcl_minecarts
description = Minecarts are vehicles to move players quickly on rails.
depends = mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons
optional_depends = doc_identifier

View File

@ -14,6 +14,8 @@ local DEFAULT_FALL_SPEED = -10
local FLOP_HEIGHT = 5.0
local FLOP_HOR_SPEED = 1.5
local LIGHT_SUN = minetest.LIGHT_MAX + 1
local MOB_CAP = {}
MOB_CAP.hostile = 70
MOB_CAP.passive = 10
@ -1057,7 +1059,7 @@ local do_env_damage = function(self)
if mod_worlds then
_, dim = mcl_worlds.y_to_layer(pos.y)
end
if (self.sunlight_damage ~= 0 or self.ignited_by_sunlight) and (minetest.get_node_light(pos) or 0) >= minetest.LIGHT_MAX and dim == "overworld" then
if (self.sunlight_damage ~= 0 or self.ignited_by_sunlight) and (minetest.get_node_light(pos) or 0) == LIGHT_SUN and dim == "overworld" then
if self.ignited_by_sunlight then
mcl_burning.set_on_fire(self.object, 10)
else

View File

@ -1 +0,0 @@
Adds a mob API for mods to add animals or monsters, etc.

View File

@ -1,3 +1,4 @@
name = mcl_mobs
depends = mcl_particles
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals, mcl_experience
description = Adds a mob API for mods to add animals or monsters, etc.

View File

@ -1,12 +0,0 @@
mcl_init
mcl_particles
default?
mcl_mobs
mcl_tnt?
mcl_bows?
mcl_throwing?
mcl_fishing?
bones?
mesecons_materials?
mobs_mc_gameconfig?
doc_items?

View File

@ -1 +0,0 @@
Adds Minecraft-like monsters and animals.

View File

@ -28,6 +28,7 @@ Pig=Schwein
Polar Bear=Eisbär
Rabbit=Kaninchen
Killer Bunny=Killerkaninchen
The Killer Bunny=Das Killerkaninchen
Sheep=Schaf
Shulker=Shulker
Silverfish=Silberfischchen

View File

@ -28,6 +28,7 @@ Pig=Cerdo
Polar Bear=Oso polar
Rabbit=Conejo
Killer Bunny=Conejo asesino
The Killer Bunny=El Conejo asesino
Sheep=Oveja
Shulker=Shulker
Silverfish=Lepisma

View File

@ -28,6 +28,7 @@ Pig=Cochon
Polar Bear=Ours blanc
Rabbit=Lapin
Killer Bunny=Lapin tueur
The Killer Bunny=Le Lapin tueur
Sheep=Mouton
Shulker=Shulker
Silverfish=Poisson d'argent

View File

@ -28,6 +28,7 @@ Pig=Свинья
Polar Bear=Полярный медведь
Rabbit=Кролик
Killer Bunny=Кролик-убийца
The Killer Bunny=Кролик-убийца
Sheep=Овца
Shulker=Шалкер
Silverfish=Чешуйница

View File

@ -1 +1,4 @@
name = mobs_mc
description = Adds Minecraft-like monsters and animals.
depends = mcl_init, mcl_particles, mcl_mobs
optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, mobs_mc_gameconfig, doc_items

View File

@ -99,7 +99,7 @@ killer_bunny.on_rightclick = nil
killer_bunny.run_velocity = 6
killer_bunny.do_custom = function(self)
if not self._killer_bunny_nametag_set then
self.nametag = "The Killer Bunny"
self.nametag = S("The Killer Bunny")
self._killer_bunny_nametag_set = true
end
end

View File

@ -123,6 +123,10 @@ mobs:register_mob("mobs_mc:snowman", {
local pos = self.object:get_pos()
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
if minetest.registered_items["mcl_farming:pumpkin_face"] then
minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, "mcl_farming:pumpkin_face")
end
-- Wear out
if not minetest.is_creative_enabled(clicker:get_player_name()) then
item:add_wear(mobs_mc.misc.shears_wear)

View File

@ -74,7 +74,7 @@ local professions = {
},
{
{ { "mcl_farming:pumpkin_face", 8, 13 }, E1 },
{ { "mcl_farming:pumpkin", 8, 13 }, E1 },
{ E1, { "mcl_farming:pumpkin_pie", 2, 3} },
},

View File

@ -1,2 +0,0 @@
mcl_init
mcl_core

View File

@ -0,0 +1,2 @@
name = mobs_mc_gameconfig
depends = mcl_init, mcl_core

View File

@ -1,2 +0,0 @@
mcl_fire
mcl_death_messages?

View File

@ -1 +0,0 @@
A mod that adds thunder and lightning effects.

View File

@ -1 +1,4 @@
name = lightning
description = A mod that adds thunder and lightning effects.
depends = mcl_fire
optional_depends = mcl_death_messages

View File

@ -1,2 +0,0 @@
mcl_worlds
mcl_death_messages

View File

@ -1 +0,0 @@
Deal damage to entities stuck in the deep void

View File

@ -1 +1,3 @@
name = mcl_void_damage
description = Deal damage to entities stuck in the deep void
depends = mcl_worlds, mcl_death_messages

View File

@ -1,3 +0,0 @@
mcl_init
mcl_worlds
lightning?

View File

@ -1 +0,0 @@
Weather and sky handling: Rain, snow, thunderstorm, End and Nether ambience

View File

@ -1 +1,4 @@
name = mcl_weather
description = Weather and sky handling: Rain, snow, thunderstorm, End and Nether ambience
depends = mcl_init, mcl_worlds
optional_depends = lightning

View File

@ -1 +0,0 @@
Provides an extensible in-game help with texts about gameplay basics (such a crafting), items and advanced usage.

2
mods/HELP/doc/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = doc
description = Provides an extensible in-game help with texts about gameplay basics (such a crafting), items and advanced usage.

View File

@ -1,6 +0,0 @@
mcl_core
mcl_compass
mcl_clock
doc
sfinv?
sfinv_buttons?

View File

@ -1,2 +0,0 @@
The most comprehensive Crafting Guide
on Minetest.

View File

@ -1 +1,5 @@
name = mcl_craftguide
description = The most comprehensive Crafting Guide
on Minetest.
depends = mcl_core, mcl_compass, mcl_clock, doc
optional_depends = sfinv, sfinv_buttons

View File

@ -1,2 +0,0 @@
doc
doc_items

View File

@ -1 +0,0 @@
This MineClone 2 mod sets up and configures the Help modpack mods to tailor the help towards MineClone 2.

View File

@ -1 +1,3 @@
name = mcl_doc
description = This MineClone 2 mod sets up and configures the Help modpack mods to tailor the help towards MineClone 2.
depends = doc, doc_items

View File

@ -1,2 +0,0 @@
tt
mcl_enchanting

View File

@ -0,0 +1,2 @@
name = mcl_tt
depends = tt, mcl_enchanting

View File

@ -1,2 +0,0 @@
sfinv?
unified_inventory?

View File

@ -1 +0,0 @@
Adds achievements to Minetest, and an API to register new ones.

View File

@ -5,3 +5,4 @@ description = Adds achievements to Minetest, and an API to register new ones.
license = LGPL 2.1 or later
forum = https://forum.minetest.net/viewtopic.php?t=4870
version = 2.3.0
optional_depends = sfinv, unified_inventory

View File

@ -413,6 +413,7 @@ function hb.hide_hudbar(player, identifier)
local name = player:get_player_name()
local hudtable = hb.get_hudtable(identifier)
if hudtable == nil then return false end
if hudtable.hudstate[name].hidden == true then return true end
if hb.settings.bar_type == "progress_bar" then
if hudtable.hudids[name].icon ~= nil then
player:hud_change(hudtable.hudids[name].icon, "scale", {x=0,y=0})
@ -431,6 +432,7 @@ function hb.unhide_hudbar(player, identifier)
local name = player:get_player_name()
local hudtable = hb.get_hudtable(identifier)
if hudtable == nil then return false end
if hudtable.hudstate[name].hidden == false then return true end
local value = hudtable.hudstate[name].value
local max = hudtable.hudstate[name].max
if hb.settings.bar_type == "progress_bar" then

View File

@ -1 +0,0 @@
awards

View File

@ -1 +1,2 @@
name = mcl_achievements
depends = awards

View File

@ -1 +0,0 @@
Provides core textures needed by Minetest.

View File

@ -1 +1,2 @@
name = mcl_base_textures
description = Provides core textures needed by Minetest.

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