Compare commits

...

599 Commits

Author SHA1 Message Date
Nathan Fritzler be213aa4b9
Remove more spellcheck stuff 2022-07-18 19:14:46 -06:00
Nathan Fritzler 559270c9a3
I don't actually need to generate this 2022-07-18 19:00:12 -06:00
Nathan Fritzler 270f20a496
The upstream file would be better to use.
I can't maintain this file.
2022-07-18 18:21:58 -06:00
Nathan Fritzler 02ee356cba
Update info on texture conversion. 2022-07-16 12:36:19 -06:00
Nathan Fritzler 7c19d30742
Update texture conversion table 2022-07-15 15:25:20 -06:00
Nathan Fritzler d39e08c080
Fixup the create_luacheck file and use it 2022-07-04 22:34:45 -06:00
Nathan Fritzler 5b43044368
There are no maps in this game 2022-06-30 19:48:21 -06:00
Nathan Fritzler fe29c83dd0
These textures aren't used. 2022-06-30 10:16:27 -06:00
Nathan Fritzler 424a697565
No nether, no dust 2022-06-29 22:15:08 -06:00
Nathan Fritzler f57399e162
There is no end! 2022-06-29 20:51:25 -06:00
Nathan Fritzler 70f8be2a0f
There's dedicated tools that can do this better 2022-06-26 13:49:10 -06:00
Nathan Fritzler b6dff1782d
Luacheck is better for this need 2022-06-24 16:24:42 -06:00
Nathan Fritzler d573ec29da
Remove `Texture_Converter.py` and mentions of it. 2022-06-23 12:59:02 -06:00
Nathan Fritzler 4e5f45f5ab
Fix time of day 2022-06-21 14:04:15 -06:00
Nathan Fritzler a5c2cad473
Fix the hand range 2022-06-21 10:28:14 -06:00
Nathan Fritzler eb25cd4f50
Don't render hand or block item ever 2022-06-21 10:27:59 -06:00
Nathan Fritzler 712179623a
Fix the exactness of the worldborder system 2022-06-20 22:44:56 -06:00
Nathan Fritzler 069ccbe010
Use halo highlighting 2022-06-19 22:22:12 -06:00
Nathan Fritzler f84dcf0940
Use protection to make a worldborder 2022-06-19 15:10:44 -06:00
Nathan Fritzler 859892d3b2
Move mapgen config to global 2022-06-17 21:07:32 -06:00
Nathan Fritzler bb54ba53e5
Just return instead of having a de-indented block 2022-06-16 22:28:21 -06:00
Nathan Fritzler 00fa1f42cc
Use a local var to store the modpath 2022-06-16 22:27:26 -06:00
Nathan Fritzler 21531eb564
Don't use opaque globals. 2022-06-16 22:13:00 -06:00
Nathan Fritzler c9ec16c2eb
Be sure to load correctly 2022-06-16 22:02:37 -06:00
Nathan Fritzler b6a140eddf
Merge Minecraftn't Pre-Classic with Mineclone 2
Co-authored-by: ROllerozxa <temporaryemail4meh+github@gmail.com>
2022-06-16 20:43:11 -06:00
epCode 5c561b951c Merge pull request 'villager_anims_and_sounds' (#2279) from villager_anims_and_sounds into master
Reviewed-on: MineClone2/MineClone2#2279
2022-06-06 19:09:59 +00:00
epCode ad486a56fd Add more Villager sounds 2022-06-06 12:09:14 -07:00
epCode 42c764e149 Make Villager nod/head shake 2022-06-06 11:12:57 -07:00
cora 6c89c8f675 Merge pull request 'shipwrecks' (#2270) from shipwrecks into master
Reviewed-on: MineClone2/MineClone2#2270
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
2022-06-05 23:12:47 +00:00
cora 4bff9710a0 Make structblock non walk- and pointable 2022-06-06 01:08:55 +02:00
cora d4e4bc8708 add rarer beached shipwreck 2022-06-05 13:10:36 +02:00
cora b7419dc207 randomly enchant treasure 2022-06-05 13:10:36 +02:00
cora 4af1094eed Add shipwrecks
schematics by chmodsayshello
2022-06-05 13:10:36 +02:00
cora dd9a93ca19 Merge pull request 'Fix crash on rapidly fired rocket-arrows' (#2273) from fix_rocket_crash into master
Reviewed-on: MineClone2/MineClone2#2273
2022-06-05 10:48:08 +00:00
cora ef093d0c00 Be more careful with possibly expired objects 2022-06-04 20:26:00 +02:00
cora f1778d839d Merge pull request 'Make items flowing in water use acceleration for movement.' (#2271) from item_movement_fix_part2 into master
Reviewed-on: MineClone2/MineClone2#2271
2022-06-03 21:29:07 +00:00
MysticTempest b4c5805afe Make items flowing in water use acceleration for movement. 2022-06-03 05:46:27 -05:00
cora b650cd8a97 Merge pull request 'Item movement fixes:' (#2269) from item_movement_fixes into master
Reviewed-on: MineClone2/MineClone2#2269
2022-06-02 09:49:31 +00:00
MysticTempest 5dde594c19 Item movement fixes:
This PR fixes items at flowing_water edges not falling down holes.
As well as fixing items not sliding on slippery nodes like ice.

And, allows for movement starting at the source block of a
flowing water node. While ensuring regular water_source blocks
do not bug out.
2022-06-02 09:44:04 +00:00
cora 44e4e53cf2 Merge pull request 'Make breaking boats by hand easier.' (#2268) from boat_breaking_by_hand_fixes into master
Reviewed-on: MineClone2/MineClone2#2268
2022-06-02 09:43:16 +00:00
MysticTempest 983b8f0934 Make breaking boats by hand easier. 2022-06-02 00:20:44 -05:00
cora b27634fcb2 Merge pull request 'Fix crash when unknown item in offhand slot' (#2265) from fix-unknown-offhand into master
Reviewed-on: MineClone2/MineClone2#2265
Reviewed-by: NO11 <no11@noreply.git.minetest.land>
2022-05-31 21:40:00 +00:00
NO11 25d847f49f Fix crash when unknown item in offhand slot 2022-05-31 22:43:30 +02:00
cora 5778c2d27a Merge pull request 'Fix items obtained from villager trades:' (#2264) from Fix_items_obtained_from_villagers into master
Reviewed-on: MineClone2/MineClone2#2264
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-30 21:21:54 +00:00
MysticTempest 31106a2031 Fix items obtained from villager trades:
This PR stops the load_enchantments function from being
called for all items in the villager trades.
Fixing non-enchanted items from villagers being unable to stack
with their regular counterparts.

As they now, no longer have any description metadata.
While also ensuring that enchanted items still have their
tooltips, and work.
2022-05-30 15:11:22 -05:00
cora ad1b7510aa Merge pull request 'Update old mobs_mc_ horse armor textures' (#2262) from legacy_horse_armor_texture into master
Reviewed-on: MineClone2/MineClone2#2262
2022-05-30 10:54:12 +00:00
cora dc21b02d04 update old mobs_mc_ horse armor textures 2022-05-30 10:49:38 +00:00
Lizzy Fleckenstein a86fc935aa mcl_maps: add callback to load_map function (#2261)
Fixes maps in itemframes not loading after restart (#2255)
Reviewed-on: MineClone2/MineClone2#2261
Co-authored-by: Elias Fleckenstein <eliasfleckenstein@web.de>
Co-committed-by: Elias Fleckenstein <eliasfleckenstein@web.de>
2022-05-30 01:32:20 +00:00
cora 50c802df98 Merge pull request 'Make new jobsite tables diggable.' (#2260) from fix_undiggable_jobsites into master
Reviewed-on: MineClone2/MineClone2#2260
Reviewed-by: Elias Fleckenstein <eliasfleckenstein@web.de>
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
2022-05-29 20:12:57 +00:00
cora a44347f641 make cart.table, fletch.table and loom diggable 2022-05-29 22:07:47 +02:00
cora a85bf22695 Merge pull request 'Spawn witch and black cat on witchhut generation' (#2246) from spawn_witches into master
Reviewed-on: MineClone2/MineClone2#2246
2022-05-29 00:35:37 +00:00
cora e4a4648b25 fix size of black cat texture 2022-05-29 02:34:02 +02:00
cora 6b9cb0062d save home coords in cat entity as well 2022-05-29 02:34:02 +02:00
cora 2337e72a23 simplify spawn logic 2022-05-29 02:34:02 +02:00
cora da6563a5b3 Spawn witch and black cat on witchhut generation 2022-05-29 02:34:02 +02:00
cora 41ebaf12a5 Merge pull request 'fix indoor weather + multiplayer issue' (#2250) from weather_fixes into master
Reviewed-on: MineClone2/MineClone2#2250
2022-05-29 00:32:16 +00:00
cora a179a1cb62 fix indoor weather + multiplayer issue 2022-05-29 02:24:12 +02:00
cora 663e6dfe9e Merge pull request 'Add Parrot perching' (#2232) from parrot_perching_2 into master
Reviewed-on: MineClone2/MineClone2#2232
2022-05-29 00:22:52 +00:00
cora 7bc63d2882 fix mcl_mobs api_changes 2022-05-28 00:06:29 +02:00
cora c0a9cb7020 don't hurt perched parrot on punch 2022-05-28 00:05:04 +02:00
cora e90e17e533 clean up perch code, smoother behavior 2022-05-28 00:05:04 +02:00
cora 3d13000599 tweak detaching behavior 2022-05-28 00:05:04 +02:00
cora 86bc398a79 don't do flying animation while perching,fix anims 2022-05-28 00:05:04 +02:00
cora 14ec1aa014 add basic parrot perching 2022-05-28 00:05:04 +02:00
cora c1114211fc Merge pull request 'Fix crash on non existent xp-hud due to gamemode' (#2249) from fix-gamemode-xp into master
Reviewed-on: MineClone2/MineClone2#2249
2022-05-27 18:15:48 +00:00
cora ae2860d017 Show/Hide XP-hud immediately after gamemode switch 2022-05-27 19:56:47 +02:00
cora 1127231ca9 Fix crash on non existent xp-hud due to gamemode 2022-05-27 15:06:25 +02:00
cora ff6af32ddf Merge pull request 'mobs-redo mobitems breakup' (#2247) from mobs-redo-mobitem-breakup into master
Reviewed-on: MineClone2/MineClone2#2247
2022-05-27 00:54:01 +00:00
cora 4dba637ed8 readd lost horse armor inv images - confusing names 2022-05-27 02:44:39 +02:00
Lizzy Fleckenstein e7898352d8 Remove mobs_mc_gameconfig 2022-05-27 02:44:39 +02:00
cora d887a97310 Merge pull request 'Add entity cramming' (#2226) from entity_cramming into master
Reviewed-on: MineClone2/MineClone2#2226
Reviewed-by: Elias Fleckenstein <eliasfleckenstein@web.de>
2022-05-26 12:21:46 +00:00
cora 47fa43825c count only mobs for cramming 2022-05-26 14:20:19 +02:00
cora af7dc0fb8f change "constant" declaration to match mcl_mobs 2022-05-26 14:16:38 +02:00
cora 87f50d6423 entity cramming: clean up check logic 2022-05-26 14:16:38 +02:00
cora fb4f21cba0 entity cramming: spare the children 2022-05-26 14:16:38 +02:00
cora 85b599edba entity cramming: check less often 2022-05-26 14:16:38 +02:00
cora b4cbc528a3 mcl_mobs: add entity_cramming 2022-05-26 14:16:38 +02:00
Lizzy Fleckenstein 96dcfb8a62 Merge pull request 'Strip trailing whitespace from files' (#2240) from EliasFleckenstein03/MineClone2:fmt into master
Reviewed-on: MineClone2/MineClone2#2240
2022-05-26 05:36:32 +00:00
Lizzy Fleckenstein f6a40ffb78
Run tools/strip_trailing_whitespace.sh 2022-05-26 07:29:28 +02:00
Lizzy Fleckenstein 6a054556cc
Add tool to strip trailing whitespace 2022-05-26 07:28:05 +02:00
cora 8210fba65b Merge pull request 'Mobs Redo Part 1' (#2245) from mobs-redo-basic-cleanup into master
Reviewed-on: MineClone2/MineClone2#2245
2022-05-25 21:19:07 +00:00
Lizzy Fleckenstein dd1f8cb59c Remove enderman gameconfig 2022-05-25 23:13:33 +02:00
Lizzy Fleckenstein ff33794487 Rename mobs global to mcl_mobs 2022-05-25 23:13:33 +02:00
Lizzy Fleckenstein e0f70b54ec Remove _cmi_is_mob 2022-05-25 23:13:33 +02:00
Lizzy Fleckenstein 4054f05a4c Remove support for invisibility mod 2022-05-25 23:13:33 +02:00
Lizzy Fleckenstein f6be8bac5a Remove checks for MCL2 mods 2022-05-25 23:13:33 +02:00
Lizzy Fleckenstein 8db9e76529 Remove unused version field 2022-05-25 23:13:33 +02:00
Lizzy Fleckenstein 6ae722a6ee Remove use_cmi 2022-05-25 23:13:33 +02:00
Lizzy Fleckenstein fc3992ceb6 Remove mobs.is_creative 2022-05-25 23:13:33 +02:00
cora d3afccad64 Merge pull request 'Fix warnings in mcl_bells and mcl_beds' (#2243) from EliasFleckenstein03/MineClone2:warn into master
Reviewed-on: MineClone2/MineClone2#2243
2022-05-25 17:54:28 +00:00
Lizzy Fleckenstein 569288b782
Fix warnings in mcl_bells and mcl_beds 2022-05-25 19:37:36 +02:00
cora 950a0607f1 Merge pull request 'Add /gamemode command for per player gamemode' (#2235) from creative_gamemode_2 into master
Reviewed-on: MineClone2/MineClone2#2235
Reviewed-by: Elias Fleckenstein <eliasfleckenstein@web.de>
2022-05-25 14:43:06 +00:00
cora d863a6298b fix/simplifiy things from review 2022-05-25 16:36:04 +02:00
cora 2499fe1e83 add complete input validation, better result msgs 2022-05-25 05:43:49 +02:00
cora f89780695e Add /gamemode command for per player gamemode 2022-05-25 05:43:49 +02:00
cora e2fc41cf51 Merge pull request 'Fix wrong argument to is_creative_enabled' (#2237) from fix_wtong_is_creative_usage into master
Reviewed-on: MineClone2/MineClone2#2237
2022-05-25 03:42:12 +00:00
cora 6a2f9e1a16 Fix wrong argument to is_creative_enabled 2022-05-25 03:41:43 +00:00
cora efbf3d9750 Merge pull request 'make soul fire drop nothing when dug' (#2238) from fix_soul_fire_drop into master
Reviewed-on: MineClone2/MineClone2#2238
2022-05-25 03:40:54 +00:00
cora bda5073d86 make soul fire drop nothing when dug 2022-05-25 05:27:52 +02:00
cora 8ad9dd0b86 Merge pull request 'Add blackstone by debian044' (#2142) from blackstone into master
Reviewed-on: MineClone2/MineClone2#2142
2022-05-24 11:29:12 +00:00
cora 11e8e7d4cc Add soul_group to s.soil&sand, torch fix recpipe 2022-05-24 13:25:59 +02:00
kabou 1931a85f24 Add blackstone to cobble group.
By adding blackstone to the group "cobble", it automatically inherits
all crafting recipes and tool repair capabilities that apply to that
group.

* Add `cobble=1` to blackstone node definition groups.
* Remove stone tools and furnace crafting recipes.
2022-05-24 13:25:45 +02:00
cora 0c65363a09 replace ' with " 2022-05-24 13:25:45 +02:00
cora b6a647e119 remove unused vars 2022-05-24 13:25:45 +02:00
cora 23e5a1c7d3 Comment out ore generation for now
The discussion about how to handle this is still ongoing. Since
this is about getting the new nodes disable ore registration
for now.
2022-05-24 13:25:45 +02:00
cora 0d8436b343 fix soul fire 2022-05-24 13:25:45 +02:00
cora 29c16eaa75 remove superfluous torch models 2022-05-24 13:25:45 +02:00
cora 2d81d31139 Fix soul torch to use the actual mcl_torches api 2022-05-24 13:25:45 +02:00
cora a9be3f0f96 remove excessive newlines 2022-05-24 13:25:45 +02:00
cora 181a7d3b11 make nether gold gen. respect mcl_generate_ores 2022-05-24 13:25:45 +02:00
cora 430dc7fd8c remove packed ice recipe 2022-05-24 13:25:45 +02:00
cora c6312e7bdd use vector.new instead of normal tables 2022-05-24 13:25:45 +02:00
cora d9f2db5950 adapt readme to mcl2 2022-05-24 13:25:45 +02:00
cora 6b058d6f38 remove changelog.md 2022-05-24 13:25:45 +02:00
cora dd928db9ea fix soul torch recipe 2022-05-24 13:25:45 +02:00
cora 67e026cb12 blackstone: remove soul lantern dupe(mcl_lanterns) 2022-05-24 13:25:45 +02:00
cora 4a0a9ba482 move depends.txt to mod.conf, add author field 2022-05-24 13:25:45 +02:00
debian044 16d79996c0 Add blackstone via cp -r & git add * ^^ 2022-05-24 13:25:45 +02:00
cora c71a6d5df7 Merge pull request 'Run tools/generate_ingame_credits.lua' (#2228) from EliasFleckenstein03/MineClone2:generate_ingame_credits into master
Reviewed-on: MineClone2/MineClone2#2228
2022-05-22 20:30:26 +00:00
Lizzy Fleckenstein 60c463b8f9
Run tools/generate_ingame_credits.lua
This should be run every time CREDITS.md is changed.
2022-05-22 21:41:40 +02:00
cora fc428da6fd Merge pull request 'Villager employment system and mob-api enhancements' (#2209) from villagers_jobsites into master
Reviewed-on: MineClone2/MineClone2#2209
2022-05-22 13:22:41 +00:00
cora 028d1c1f4f do not tame villagers 2022-05-22 14:43:44 +02:00
cora a5ba8f739f Add bell to villager trades 2022-05-22 02:01:21 +02:00
cora d34191f00c villagers go to the bell if it's rung(for now)
this will help with further testing pathfinding until villagers
get a proper schedule and do more things
2022-05-22 02:01:21 +02:00
cora ec73afd21a use iron texture for apprentice badge, not stone 2022-05-22 02:01:21 +02:00
cora fca259c074 fix crash during (artificial) village creation
when using the village tool doing that on an unsuitable location
would result in no position for the belltower being available
this checks for that and ... doesn't crash then ^^
2022-05-22 02:01:21 +02:00
cora 7379d5bee8 Add Belltower to villages 2022-05-21 14:48:56 +02:00
cora d67dd0577f fix crash through forgotten function call 2022-05-21 12:36:57 +02:00
cora e353ec3b16 Iron golems pick and pick up one (stack of) poppy 2022-05-21 12:36:57 +02:00
cora 5dafeaadc6 Fix indentation in mcl_mobs/api.txt 2022-05-21 12:36:57 +02:00
cora 2b63866c14 spawn villagers (and golem) immediately after mg 2022-05-21 12:36:57 +02:00
cora 27d0d778e2 Update TODO list 2022-05-21 12:36:57 +02:00
cora a74fcab06b Make iron golem stay near set _home position 2022-05-21 12:36:57 +02:00
cora e51ea1e079 initialize inventory nodes on mapgen 2022-05-21 12:36:57 +02:00
cora e5806215f0 fix possible crash 2022-05-21 12:36:57 +02:00
cora 08b36e3eb3 Add textures for all professions 2022-05-21 12:36:57 +02:00
cora 53df441c1b Don't pick up near player, add more breeding stuff 2022-05-21 12:36:57 +02:00
cora 873e018faf Dynamically add trading tier badge to texture 2022-05-21 12:36:57 +02:00
cora b58422a584 write villager id into bed nodemeta 2022-05-21 12:36:57 +02:00
cora 3ff4ea576d spawn iron golem on villagegen 2022-05-21 12:36:57 +02:00
cora 539c31e8d6 fix trading crash 2022-05-21 12:36:57 +02:00
cora db865ede56 villagers open doors in daytime and close at night 2022-05-21 12:36:57 +02:00
cora 0d56ef1a90 add jobsites to villagegen schematics 2022-05-21 12:36:57 +02:00
cora 67939f7b7a pathfinding: find doors close to target as well 2022-05-21 12:36:57 +02:00
cora 9ccbf91706 mobs api: document api additions 2022-05-21 12:36:57 +02:00
cora dfb74cf9e9 mobs: add nofollow option so v. dont follow bread 2022-05-21 12:36:57 +02:00
cora 9a866e873e breed by throwing bread at villagers 2022-05-21 12:36:57 +02:00
cora e6b65af3b4 add mobs item pickup 2022-05-21 12:36:57 +02:00
cora 4ac41a793e fix two crashes in pathfinding 2022-05-21 12:36:57 +02:00
cora 98231f15ae change function name go_wplist -> gopath 2022-05-21 12:36:57 +02:00
cora e3bb7fe4be codestyle: replace inline functions 2022-05-21 12:36:57 +02:00
cora f8fc111b4a pathfind to jobsites 2022-05-21 12:36:57 +02:00
cora dbc5564d02 move movement code to mcl_mobs 2022-05-21 12:36:57 +02:00
cora ce7a882c86 Show trade tier in formspec 2022-05-21 12:36:57 +02:00
cora 12bc8f1a3b initial pathfinding experiments
to test rightclick a villager and it will try to path find to
0,9,0 (i'm using flat mapgen for testing for now).
2022-05-21 12:36:57 +02:00
cora 0598aa35c0 add simple jobsite logic 2022-05-21 12:36:57 +02:00
cora 72f2cd26f8 Merge pull request 'Add bell' (#2216) from add_bell into master
Reviewed-on: MineClone2/MineClone2#2216
2022-05-21 10:36:04 +00:00
cora e9f4f500d9 bell: slightly tweak bottom texture 2022-05-21 12:35:22 +02:00
cora 63b6a1d176 Update README.md 2022-05-20 21:54:42 +02:00
cora 1ba12aec60 Add new textures, make bell a nodebox
thx erlehmann for the nodebox <3
2022-05-20 21:27:12 +02:00
cora 4ba570e3b4 remove mesecons dependency 2022-05-20 13:45:45 +02:00
cora bf1a939564 fix bell sound 2022-05-20 13:44:17 +02:00
cora fe164e5f41 add basic mcl2 node properties 2022-05-20 13:36:41 +02:00
kay27 a6e9afbb93 Add bell from mcl5 2022-05-20 13:33:39 +02:00
cora dc30517cd9 Merge pull request 'xmas chests' (#2215) from xmas-chests into master
Reviewed-on: MineClone2/MineClone2#2215
2022-05-20 10:41:06 +00:00
Nils Dagsson Moskopp c9c14d6ff0 Add noise to christmas chest textures 2022-05-20 04:13:13 +02:00
Nils Dagsson Moskopp ff384c9588 Reskin chests as presents on December 24th to 26th 2022-05-20 04:13:01 +02:00
cora 1192fe5450 Merge pull request 'Smoker and Blast furnace fixes' (#2213) from blast_furnace_fix into master
Reviewed-on: MineClone2/MineClone2#2213
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-18 14:45:56 +00:00
cora c4e51650f8 smoker & bfurnace: More concise short descriptions 2022-05-18 13:37:34 +02:00
cora 8426e7826a Fix smoker fuel not being burned at twice the rate. 2022-05-18 13:30:00 +02:00
MysticTempest d10f8944ed Fix blast_furnace fuel not being consumed at twice the rate. 2022-05-18 05:30:05 -05:00
PrairieWind 66cd32b6ff Merge pull request 'Blast Furnaces and Smokers' (#2210) from PrairieAstronomer/MineClone2:furnaces into master
Reviewed-on: MineClone2/MineClone2#2210
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-17 22:20:23 +00:00
PrairieWind d93704fa0e Merge branch 'master' into furnaces 2022-05-17 18:33:20 +00:00
PrairieAstronomer fe36d579eb Add Blast Furnace and Smoker to Villager Workstations 2022-05-17 10:37:55 -06:00
PrairieAstronomer 4af0a4daae Updated GROUPS.md and fixed blast furnace group name. 2022-05-17 10:34:44 -06:00
PrairieAstronomer fd18c0d213 Removed Unneeded Code from Blast Furnace, and updated description. 2022-05-17 10:27:41 -06:00
PrairieAstronomer 7ac2593164 Removed Unneed code and fixed description of Smoker 2022-05-17 10:03:15 -06:00
PrairieAstronomer 29e18015b8 Make Fish and Salmon Smokable 2022-05-17 09:48:51 -06:00
PrairieAstronomer e1a6baffe9 Smoker 2022-05-16 21:11:10 -06:00
PrairieAstronomer f1a80876de Make Copper Ore Blastable 2022-05-16 20:59:19 -06:00
PrairieAstronomer 3558541648 Blast Furnace 2022-05-16 20:45:45 -06:00
cora 3a9812a2d7 Merge pull request 'Add a command to safely remove all mob objects' (#2098) from add_clearmombs_command into master
Reviewed-on: MineClone2/MineClone2#2098
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
2022-05-15 20:07:41 +00:00
cora 5282a63bcb add options for nametagged mobs and range 2022-05-15 20:04:09 +00:00
cora e5de4bba65 keep nametagged mobs, add "all" argument 2022-05-15 20:04:09 +00:00
cora 628686ce79 Add a command to safely remove all mob objects 2022-05-15 20:04:09 +00:00
cora abe419caf9 Merge pull request 'MISC/mcl_commands: Improve /seed command (now it looks like in modern MC) and update RU locale' (#2208) from rudzik8/MineClone2:commands-improve into master
Reviewed-on: MineClone2/MineClone2#2208
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-15 19:38:47 +00:00
Mikita Wiśniewski 37e72e333b Improve /seed command (now it looks like in modern MC) and update RU locale 2022-05-15 20:27:30 +07:00
cora e322a9e23a Merge pull request 'Implement piston fixes:' (#2207) from redstone_piston_fixes into master
Reviewed-on: MineClone2/MineClone2#2207
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-15 10:30:11 +00:00
MysticTempest dd1a58b01e Implement piston fixes:
This enables the feature of unsticky pistons. This allows
for some nodes to be unpullable, but otherwise pushable or diggable.
A certain selection of nodes that can never be moved.
And, stops certain entities from being pushed if they shouldn't move.

Along with this change; I've also updated the rules regarding
pushing, and pulling of nodes & objects to be more accurate to MC.
Now allowing for more complex redstone circuits to be built.
2022-05-15 02:18:21 -05:00
cora 87c9969801 Merge pull request 'Villager Workstations' (#2206) from PrairieAstronomer/MineClone2:villager_workstations_1 into master
Reviewed-on: MineClone2/MineClone2#2206
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-14 22:21:47 +00:00
PrairieAstronomer fec5650711 Removed dependancies 2022-05-14 16:01:14 -06:00
PrairieAstronomer 5abfa555eb Added new workstations to villager jobsite definitions 2022-05-14 15:52:37 -06:00
PrairieAstronomer dead4069b0 Removed incorrect groups 2022-05-14 15:48:33 -06:00
PrairieAstronomer 4bc67a174b Loom 2022-05-14 15:34:08 -06:00
PrairieAstronomer c71b036e6a Cartography Table 2022-05-14 15:24:44 -06:00
PrairieAstronomer 046698c64f Fletching Table 2022-05-14 15:14:50 -06:00
cora e80eebd989 Merge pull request 'Update villager trades' (#2202) from villagers_update_2 into master
Reviewed-on: MineClone2/MineClone2#2202
2022-05-13 22:35:27 +00:00
cora 31b8ea26a2 add jobsites to professions table 2022-05-14 00:32:15 +02:00
cora fd6f2be485 update cleric trades 2022-05-14 00:32:15 +02:00
cora 07e0a90051 update tool smith trades 2022-05-14 00:32:15 +02:00
cora f073d4d420 update weapon smith trades 2022-05-14 00:32:15 +02:00
cora 89aaf6b709 update butcher trades 2022-05-14 00:32:15 +02:00
cora f09b578034 update leatherworker trades 2022-05-14 00:32:15 +02:00
cora 0ce1a92282 update armorer trades 2022-05-14 00:32:15 +02:00
cora 135ee97b21 update cartographer trades 2022-05-14 00:32:15 +02:00
cora 51cf92a909 update librarian trades 2022-05-14 00:32:15 +02:00
cora 2d47ad3e5f update fletcher trades 2022-05-14 00:32:15 +02:00
cora c28d700caf update fisherman trades 2022-05-14 00:32:15 +02:00
cora ba861d7b74 update farmer trades 2022-05-14 00:32:15 +02:00
cora 9b8b7ce6b4 refactor go home logic 2022-05-14 00:32:15 +02:00
cora 046b3a4ce2 Merge pull request 'enable simple mcl_mobs/mobs redo villager breeding' (#2204) from villager_breeding into master
Reviewed-on: MineClone2/MineClone2#2204
2022-05-13 22:31:15 +00:00
cora 354d17a14c enable simple villager breeding 2022-05-14 00:30:44 +02:00
cora 11265b60de Merge pull request 'Enable placing carpets on llamas and add textures for it' (#2201) from rudzik-llama-carpets into master
Reviewed-on: MineClone2/MineClone2#2201
2022-05-13 22:07:34 +00:00
Mikita Wiśniewski 7f3ba7d4a2 Enable placing carpets on llamas and add textures for it 2022-05-13 22:00:09 +00:00
cora 88e87bccff Merge pull request 'playerplus: fix deprecated add_player_velocity calls' (#2200) from fix-deprecated-add-vel into master
Reviewed-on: MineClone2/MineClone2#2200
2022-05-13 21:51:46 +00:00
cora a1209b14a1 playerplus: fix deprc. add_player_velocity calls 2022-05-12 23:30:39 +00:00
cora 729159f631 Merge pull request 'Refactor compass code.' (#2197) from get-compass-image-fix into master
Reviewed-on: MineClone2/MineClone2#2197
Reviewed-by: cora <cora@noreply.git.minetest.land>
Reviewed-by: chmodsayshello <chmodsayshello@hotmail.com>
2022-05-12 21:37:16 +00:00
kabou baf8e0b79c Update item entity for lodestone compass.
* Added another special case to the item entity registration for
  lodestone compasses, without this a dropped lodestone compass would
  turn into a regular compass on being dropped.
* Update the compass and lodestone compass frame number to be the
  stereotype frame.
2022-05-12 21:08:52 +02:00
chmodsayshello 00dba67cd8 remove lodestone compass from creative inventory 2022-05-12 19:06:13 +02:00
kabou 872b708465 Remove unused variable.
* Removed unused variable `stack_max`.
2022-05-11 21:45:15 +02:00
kabou 74e70b674e Fix return value of `get_compass_image()`.
* `get_compass_image()` did not actually return the image number.
2022-05-11 21:43:52 +02:00
kabou 14c882f982 Fix lodestone compass meta handling.
* The nature of a compass was being determined by looking at its meta.
  This caused lodestone compasses with unset meta to turn into regular
  compasses.  Fixed by using string matching on the itemname.
* Changed lodestone rightclick handler to explicitly set the correct
  name and frame of the compass used on it instead of waiting for
  globalstep to do this.
2022-05-11 21:31:50 +02:00
kabou 8ae605165b Fix lodestone compass stack_max.
* Lodestone compasses are stackable.
* Remove hardcoded `stack_max` setting, use default.
2022-05-11 17:53:41 +02:00
kabou aca4aca79b Add German translation.
* Add "de" (German) translation by chmodsayshello.
2022-05-11 17:43:57 +02:00
kabou bacc7613b5 Fix crash in mt 5.4 with vector ops.
* `vector.from_string()` is not available in mt pre-5.5.  Replace with
  `minetest.string_to_pos()`.
2022-05-11 17:41:10 +02:00
kabou 8a4b8707fa Add new compass API.
* Add API.md
* Update mcl_itemframes to use the new API.
* Revert old exported function back to original API.
2022-05-10 23:38:28 +02:00
kabou a8c231da34 Refactor compass code.
* Split up `get_compass_image()` into smaller functions.  This allows
  for better code sharing between old and new API and globalstep fn.
* Add `get_compass_itemname()` function.  It will be the new API of
  choice, `get_compass_image() will be deprecated soon.
* Remove function declaration out of globalstep function.
* Various other performance improvements.
* Add local aliases for global functions
* Lodestone compasses can only stack 1 item.
* Document functions and variables.
* Fix lodetone compass inaccurately reusing compass descriptions.
* Add usage descriptions to node definitions
* Refactor craftitem registration code.
* Update translation templates.
2022-05-10 22:43:03 +02:00
cora 4d342b8365 Merge pull request 'Village(r)s update' (#2189) from villager_spawning into master
Reviewed-on: MineClone2/MineClone2#2189
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
2022-05-09 22:01:25 +00:00
cora 12a943e222 Make villagers homeless when bed is gone on return 2022-05-09 10:29:58 +00:00
cora 8d0afede37 don't block mapgen on village generation 2022-05-09 10:29:57 +00:00
cora 0288581407 increase wait til village generated 2022-05-09 10:29:57 +00:00
cora 3774044f86 Walk back to bed instead of teleporting 2022-05-09 10:29:57 +00:00
cora 46dbf8c0ab Spawn villagers on villagegen, stay in village
This spawns a villager per bed on village gen and saves the bed
position in the entity. If it moves too far from the village
it gets teleported (for now) back.
2022-05-09 10:29:57 +00:00
cora 7c263c6a18 Merge pull request 'Potion Fixes:' (#2191) from Fix_waterbreathing_and_potion_icons into master
Reviewed-on: MineClone2/MineClone2#2191
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-09 10:25:51 +00:00
MysticTempest 44b1d583a7 Potion Fixes:
Ensure all potion icons disappear after their effect is gone.
Stop Breath bar from flashing when water_breathing is in effect.
2022-05-09 05:18:59 -05:00
cora 1565999134 Merge pull request 'fix the 2nd nether dust warning' (#2190) from fix_weather_warning_2 into master
Reviewed-on: MineClone2/MineClone2#2190
2022-05-09 10:09:18 +00:00
cora 5a25e42fd3 fix the 2nd nether dust warning ^^ 2022-05-09 12:06:28 +02:00
cora 421995deb3 Merge pull request 'Fix list of spawnable biomes for rabbits.' (#2187) from rabbit_spawn_fix into master
Reviewed-on: MineClone2/MineClone2#2187
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-08 20:01:56 +00:00
kabou 4e3a2a7b4c Fix list of spawnable biomes for rabbits.
* Rabbits spawn in Desert biome.
* Rabbits do no spawn in Forest and Swamp biomes.
2022-05-08 19:59:04 +00:00
cora e8e565fc06 Merge pull request 'Add Respawn Anchor (PR with branch in mcl2 repo)' (#2188) from respawn_anchor into master
Reviewed-on: MineClone2/MineClone2#2188
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-08 19:57:43 +00:00
chmodsayshello 6cb08a3c87 update dependencies 2022-05-08 19:57:09 +00:00
chmodsayshello 31a8ddabb8 minor changed (see long description)
This commit makes charged respawn anchors light sources, all respawn anchors can no longer be pushed by pistons and always drop the uncharged one
2022-05-08 19:57:09 +00:00
chmodsayshello 6806ea311d code from inital PR 2022-05-08 19:57:09 +00:00
cora ea2b53b231 Merge pull request 'Adopt mob spawning from mcl5' (#2120) from mcl5-spawning into master
Reviewed-on: MineClone2/MineClone2#2120
2022-05-08 19:48:36 +00:00
cora e1ed990f58 sp. farm animals on grass, villagers near beds 2022-05-08 18:50:37 +00:00
cora e4c5f81524 make husks spawn only in deserts, zombies not 2022-05-08 18:50:37 +00:00
kay27 53042b6f48 Adopt mob spawning from mcl5 2022-05-08 18:50:37 +00:00
cora fbe048087f Merge pull request 'Add wither spawning by EliasFleckenstein03' (#2146) from wither_spawning into master
Reviewed-on: MineClone2/MineClone2#2146
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
2022-05-06 20:57:43 +00:00
Elias Fleckenstein 34e5bb0334 Add Wither Spawning 2022-05-06 19:40:39 +00:00
Elias Fleckenstein c05a2d3a9d Add wither spawning schems 2022-05-06 19:40:39 +00:00
cora 40d2e3b2b1 Merge pull request 'Fix referencing mistake with cracked deepslate' (#2184) from fix_ds_bricks into master
Reviewed-on: MineClone2/MineClone2#2184
2022-05-06 17:24:09 +00:00
cora f1fc84b31b fix referencing mistake with cracked deepslate 2022-05-06 10:48:02 +00:00
cora 85fb33aa4c Merge pull request 'Add amethyst stuff by emojigit and kay27' (#2149) from amethyst into master
Reviewed-on: MineClone2/MineClone2#2149
Reviewed-by: AFCMS <afcm.contact@gmail.com>
2022-05-05 20:54:46 +00:00
AFCMS f9a2dacdd4 Fix texture and sound names in `mcl_amethyst` 2022-05-05 22:49:23 +02:00
AFCMS 00c70014c7 Fix codestyle and translation of `mcl_amethyst` 2022-05-05 22:49:23 +02:00
3raven f4020ebd31 mcl_amethyst.fr.tr
Translation
2022-05-05 22:49:23 +02:00
kay27 74322ead49 #11 Polish amethyst stuff 2022-05-05 22:49:23 +02:00
kay27 1a83f50505 Fix amethyst buds light levels again 2022-05-05 22:49:23 +02:00
kay27 206c98e354 Fix various amethyst errors, better seed function 2022-05-05 22:49:23 +02:00
kay27 69e83d5c0a #11 Spawn buds 2022-05-05 22:49:23 +02:00
kay27 d3dfd13f78 #11 Fix the style, add template.txt, add Russian translation 2022-05-05 22:49:23 +02:00
kay27 e28ccd9a80 #11 Put tabs instead of each 2 spaces 2022-05-05 22:49:23 +02:00
kay27 a5fba06a2c #11 Remove amethyst screenshot 2022-05-05 22:49:23 +02:00
1F616EMO 6c36c83a18 AMethyst Growing 2022-05-05 22:49:23 +02:00
1F616EMO 48a4e069f9 craft bugfix 2022-05-05 22:49:23 +02:00
1F616EMO 60e04438e0 typo missing space 2022-05-05 22:49:23 +02:00
1F616EMO 0b01d299ea 更新 'mods/ITEMS/mcl_amethyst/init.lua' 2022-05-05 22:49:23 +02:00
1F616EMO ebdf944dda amethyst bud 2022-05-05 22:49:23 +02:00
1F616EMO 794e10df4e [mcl_amethyst] INIT
* Amethyst Block
* Budding Amethyst (won't  grow amethyst now)
* New spyglass recipe
* Tinted Glass
* Calcite
2022-05-05 22:49:23 +02:00
cora 1cc8a7f8df Merge pull request 'Remove ancient backup "init_new.lua"' (#2178) from remove_ancient_backup_file into master
Reviewed-on: MineClone2/MineClone2#2178
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
2022-05-05 12:32:11 +00:00
cora 6a2fe2eb4f remove ancient backup "init_new.lua" 2022-05-05 04:05:08 +00:00
cora 6674684998 Merge pull request 'Add deepslate, copper and raw_ores by NO11' (#2141) from deepslate-copper-rawores into master
Reviewed-on: MineClone2/MineClone2#2141
Reviewed-by: AFCMS <afcm.contact@gmail.com>
2022-05-05 00:40:31 +00:00
kabou 1266396e1d Add cobbled deepslate to cobble group.
By adding cobbled deepslate to the group "cobble", it automatically
inherits  all crafting recipes and tool repair capabilities that apply
to that group.

* Add `cobble=1` to cobbled deepslate node definition groups.  This
  requires a little refactoring of the deepslate variants registration
  function.
* Remove stone tools, furnace and brewing stand crafting recipes.
2022-05-05 01:45:03 +02:00
kabou f5abc28190 Allow smelting of deepslate ores.
* Register "cooking" crafting recipe for deepslate ores that enables
  smelting these ores in furnaces.
* Extend deepslate ore registration function to allow passing cooking
  result as argument.
* Update the deepslate ore table to include smelting results.
* Put deepslate w/ lapis drops in a separate table, making the deepslate
  ores table less unwieldly.
2022-05-04 23:35:07 +00:00
AFCMS f8f6ea22c8 Fix codestyle issues with `mcl_deepslate`, `mcl_copper`, `mcl_raw_ores` 2022-05-04 23:35:07 +00:00
cora b0b8ef3921 Comment out ore registrations for now
The discussion about how to handle the new ores is still ongoing.
This PR was originally only intended to add the new nodes so
that's what it does now.
2022-05-04 23:35:07 +00:00
cora be6d2db7d4 remove redundant license files 2022-05-04 23:35:07 +00:00
cora dc40ed18b3 remove raw_ores item override 2022-05-04 23:35:07 +00:00
cora 1b99de73d2 remove screenshots from original mods 2022-05-04 23:35:07 +00:00
NO11 c97e0cd631 Add deepslate 2022-05-04 23:35:07 +00:00
NO11 8c7a8a61d2 Add Copper 2022-05-04 23:35:07 +00:00
NO11 6bdaa9f2d1 Add raw ores 2022-05-04 23:35:06 +00:00
cora 8b8a133381 Merge pull request 'Fix undefined variable in mcl_enchanting/engine.lua.' (#2177) from fix_enchanting into master
Reviewed-on: MineClone2/MineClone2#2177
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-04 23:34:18 +00:00
kabou dceb48bf94 Fix undefined variable in mcl_enchanting/engine.lua. 2022-05-04 23:31:54 +00:00
cora e10c06ba98 Merge pull request 'Remove 2D preview + fix enchanting overlay (Fix #1869, #2161)' (#2162) from remove_3d_preview into master
Reviewed-on: MineClone2/MineClone2#2162
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-04 23:20:50 +00:00
AFCMS 8a47a195f6 Remove preview files 2022-05-04 23:15:11 +00:00
AFCMS d0b60e2399 Fix player armor enchanting overlay (#2161) 2022-05-04 23:15:11 +00:00
AFCMS 3ca40cd4e4 Remove 2D preview 2022-05-04 23:15:11 +00:00
cora 0e8a87befa Merge pull request 'Bookshelves are deco blocks, not building blocks.' (#2175) from bookshelf-deco-block into master
Reviewed-on: MineClone2/MineClone2#2175
2022-05-04 23:11:57 +00:00
kabou 920b8b9654 Bookshelves are deco blocks, not building blocks. 2022-05-04 23:06:05 +00:00
cora dab80c45fd Merge pull request 'Add "cobble" group.' (#2174) from cobble_group into master
Reviewed-on: MineClone2/MineClone2#2174
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-04 23:05:01 +00:00
kabou f1a494ea62 Change stone tool repair materal to group:cobble.
* Update repair material for stone tools (pick, shovel, axe, sword and
  hoe) to use any cobble group stone.
2022-05-05 01:01:29 +02:00
kabou 64bb50dfd5 Change some crafting recipes to use group:cobble.
* Update crafting recipes for stone tools (pick, shovel, axe, sword and
hoe), furnace and brewing stand to use any cobble group stone.
2022-05-04 15:54:12 +02:00
kabou 9edb40b5c5 Add cobblestone to the `cobble` group. 2022-05-04 15:14:23 +02:00
kabou b0ae135b3c Add `cobble` group.
* Add `cobble` group to GROUPS.md, to be used in crafting recipes.
2022-05-04 15:12:27 +02:00
cora b13835dd6f Merge pull request 'Fix crash when trying to use awards if they are disabled for the player (#2164)' (#2170) from awards_crashfix into master
Reviewed-on: MineClone2/MineClone2#2170
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-03 20:11:44 +00:00
chmodsayshello 3699ca5535 update translation template 2022-05-03 15:21:18 +00:00
chmodsayshello 9c652df8a2 update german translation 2022-05-03 14:59:49 +00:00
chmodsayshello 390802a344 fix crash when achievements are disabled and /awards is being used
This commit fixes  MineClone2/MineClone2#2164, which crashes the game whenever /awards is called with arguments other than enable
2022-05-03 14:58:44 +00:00
cora a27abae045 Merge pull request 'Fix warning in mcl_weather (#2157)' (#2168) from fix_weather_warning into master
Reviewed-on: MineClone2/MineClone2#2168
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
2022-05-03 00:41:06 +00:00
cora 61a999fe5a Fix warning in mcl_weather 2022-05-02 21:47:33 +02:00
cora 85afc8bd53 Merge pull request 'Fix `add_large_plant()` argument mismatch in mcl_flowers.' (#2156) from fix-flowers-fortune into master
Reviewed-on: MineClone2/MineClone2#2156
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-01 10:32:49 +00:00
kabou ed8995acec Fix `add_large_plant()` argument mismatch.
* In commit 86b2cd70f9 an extra argument
  was added to the `add_large_plant()` function in order to handle silk
  touch.  For some reason, the callers for "double_grass" and
  "double_fern" were updated with two new arguments.  Because of this,
  silk touch likely never worked on these nodes.  This commit removes
  the unused `nil` argument from both callers.
* This commit fixes #2155.
2022-05-01 10:31:01 +00:00
cora 38f1db7a04 Merge pull request 'Add Lodestones (rebased)' (#2154) from chmodsayshello/MineClone2:lodestone_rebased into master
Reviewed-on: MineClone2/MineClone2#2154
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-05-01 00:38:50 +00:00
chmodsayshello f1c60a48e0 remove debug logging 2022-04-30 10:02:04 +00:00
chmodsayshello c97fc42b68 upload textures 2/2 2022-04-30 09:02:17 +00:00
chmodsayshello 92cd3381ad upload textures 1/2 2022-04-30 09:01:57 +00:00
chmodsayshello f7a5862df2 update mcl_itemframes to use get_compass_image correctly 2022-04-30 08:59:25 +00:00
chmodsayshello ba8e072265 update mcl_compass dependencies 2022-04-30 08:58:04 +00:00
chmodsayshello f9d8b61dc1 update mcl_compass init.lua 2022-04-30 08:57:03 +00:00
chmodsayshello dd727510ba Merge pull request 'Update Fork' (#4) from MineClone2/MineClone2:master into master
Reviewed-on: chmodsayshello/MineClone2#4
2022-04-30 08:55:15 +00:00
cora a4e8c0b884 Merge pull request 'Add packed ice crafting recipe' (#2145) from add-packed-ice-recipe into master
Reviewed-on: MineClone2/MineClone2#2145
2022-04-27 22:04:23 +00:00
Nils Dagsson Moskopp 057051aa6d Add packed ice crafting recipe 2022-04-27 00:33:01 +02:00
cora 83aebb8b99 Merge pull request 'set version to 0.75 (indev)' (#2144) from 075-indev into master
Reviewed-on: MineClone2/MineClone2#2144
2022-04-26 09:51:05 +00:00
cora deb2e1c50b set version to 0.75 (indev) 2022-04-26 11:50:11 +02:00
cora 7d9cbd5f84 Merge pull request 'change version to 0.74' (#2143) from release_074 into master
Reviewed-on: MineClone2/MineClone2#2143
2022-04-26 03:55:15 +00:00
cora deb2c4ab50 change version to 0.74 2022-04-26 05:53:20 +02:00
cora 64ec36fe36 Merge pull request 'Dirt types fixes' (#2109) from dirt_type_fixes into master
Reviewed-on: MineClone2/MineClone2#2109
2022-04-25 21:39:27 +00:00
Nils Dagsson Moskopp cbf3dc49aa Replace grass path with dirt path
If a player wants to make a path when there is no dirt with grass on the
ground it means they need to either have silk touch to collect dirt with
grass or place dirt beside dirt with grass and wait for the grass cover
to spread before they can create the new paths …

Since the former is not possible early in the game and the latter is not
easy, this patch imitates Minecraft 1.17 behaviour; the following nodes
can now be turned into path nodes by right-clicking them with a shovel:

• Dirt (mcl_core:dirt)
• Coarse Dirt (mcl_core:coarse_dirt)
• Dirt with Grass (mcl_core:dirt_with_grass)
• Mycelium (mcl_core:mycelium)
• Podzol (mcl_core:podzol)

A group “path_creation_possible” has been added to mark nodes that can
be turned into a dirt path with a shovel. One obvious objection to that
addition might be that the “dirt” group already exists. Even though all
existing nodes that can be turned into a dirt path do indeed belong to
the “dirt” group, it is not a good idea: Changing what “dirt” means to
“any node that can be turned into a dirt path” would make it harder to
maintain the code.
2022-04-25 15:33:01 +02:00
cora 6bc676545b Allow saplings to grow on coarse d. and mycelium 2022-04-25 15:30:45 +02:00
chmodsayshello 77c2f9371e Merge pull request 'Update Fork' (#1) from MineClone2/MineClone2:master into master
Reviewed-on: chmodsayshello/MineClone2#1
2022-04-25 12:31:14 +00:00
cora 4cdb1130af Merge pull request 'Add hypercopyrighted end crystal beam texture' (#2134) from add-hypercopyright-beam into master
Reviewed-on: MineClone2/MineClone2#2134
2022-04-25 03:38:10 +00:00
cora 5f126c4686 add hypercopyrighted end crystal beam texture
This texture has the following poem written by me, cora, encoded in its
pixeldata. I the author hereby release both the texture file and the
poem as cc0.

Additionally I explicitly consent with its inclusion into MineClone2,
MineClone5 and Mineclonia as well as any other minetest game for this
day and all the days to come.

Shall though betray me with a texture, mate
I'll smile at though just like a summer's day
The raindrop particles - no laggy state
But spring is coming, really, soon it's may

As If the seasons meant a damn to us
They do not exist in mineclone at all
unreal water flow, iron never rusts
but copper does in summer and in fall

But what this literally is about
because this damn thing is really silly
you see somehow they had to say it loud

I would bring that quote with painting lilys
but plagerism everywhere you see
so this will just be good enough for me
2022-04-24 01:46:57 +02:00
cora dd12417529 Merge pull request 'Use uncarved pumpkin in survival' (#2119) from uncarved_pumpkins into master
Reviewed-on: MineClone2/MineClone2#2119
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
2022-04-22 20:01:23 +00:00
Nils Dagsson Moskopp 67ae203772 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-22 18:07:37 +00:00
Nils Dagsson Moskopp 5ba36c08b6 Drop carved pumpkin when shearing snow golem 2022-04-22 18:07:37 +00:00
Nils Dagsson Moskopp 56db877360 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-22 18:07:37 +00:00
Nils Dagsson Moskopp e1d67a2095 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-22 18:07:37 +00:00
Nils Dagsson Moskopp a2dd8c935d 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-22 18:07:37 +00:00
Nils Dagsson Moskopp 4fda54b0d1 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-22 18:07:37 +00:00
Nils Dagsson Moskopp 9a53761b08 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-22 18:07:37 +00:00
Alexander Minges 9b614c115c 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-22 18:07:37 +00:00
Alexander Minges faf3f60cff Use uncarved pumpkin instead of carved in mapgen 2022-04-22 18:07:37 +00:00
cora 1bcbdfbc4c Merge pull request 'Fix endermen dropping node AND taking it (#2122)' (#2130) from fix_enderman_dupe into master
Reviewed-on: MineClone2/MineClone2#2130
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
2022-04-22 10:25:46 +00:00
cora b6ab815adc Fix endermen dropping node AND taking it 2022-04-22 01:02:20 +02:00
cora 511b7030e1 Merge pull request 'Generate podzol when planting huge spruce trees' (#2126) from spruce_podzol into master
Reviewed-on: MineClone2/MineClone2#2126
Reviewed-by: AFCMS <afcm.contact@gmail.com>
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
2022-04-21 22:27:10 +00:00
cora a83a2e9aba generate podzol under huge spruce trees 2022-04-21 22:25:47 +00:00
cora 0c03d420b8 Merge pull request 'Check protection on dragon egg punch (#2127)' (#2129) from enderdragon_egg_fix into master
Reviewed-on: MineClone2/MineClone2#2129
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-04-21 19:41:27 +00:00
AFCMS 8396dfe7e3
enderdragon egg: check for protection on punch 2022-04-21 21:02:43 +02:00
cora 231b658c3f Merge pull request 'Lift clouds to 384 in valleys mapgen' (#2110) from raise_valleys_clouds into master
Reviewed-on: MineClone2/MineClone2#2110
2022-04-19 10:26:41 +00:00
kay27 dc4ccf91cc lift clouds to 384 in valleys mapgen
Valleys has a much higher average elevation than v7 often leading
to "normal" looking terrain being in the clouds. This lifts the
clouds up higher.
2022-04-19 10:23:10 +00:00
cora 8bf1d2b235 Merge pull request 'Fix sugarcane not getting param2 on mapgen' (#2118) from fix_sugarcane_color into master
Reviewed-on: MineClone2/MineClone2#2118
2022-04-19 10:22:22 +00:00
cora 3cb9947cf4 fix sugarcane not getting param2 on mapgen 2022-04-19 12:16:07 +02:00
cora d1cd46e197 Merge pull request 'change version in readme to 0.74 (indev)' (#2115) from change-readme-074-indev into master
Reviewed-on: MineClone2/MineClone2#2115
2022-04-16 11:01:40 +00:00
cora 33097a7656 change version in readme to 0.74 (indev) 2022-04-16 11:59:10 +02:00
cora 9ad4222f35 Merge pull request 'update readme to 0.73.1' (#2114) from release_0731 into master
Reviewed-on: MineClone2/MineClone2#2114
2022-04-16 09:52:56 +00:00
cora feb1fcc5b4 update readme to 0.73.1
Since "someone" had to make a huge deal publicly about supposed
copyright problems we need to do yet another release because
of this.
2022-04-16 11:48:42 +02:00
cora 6976ffca62 Merge pull request 'Shuffle pixels in mcl_end_crystal_beam.png' (#2113) from fix_mcl_end_crystal_beam into master
Reviewed-on: MineClone2/MineClone2#2113
2022-04-16 09:23:32 +00:00
Nils Dagsson Moskopp 34b5002fc8
Shuffle pixels in mcl_end_crystal_beam.png
A user claimed that this texture was a texture from Minecraft 1.8.9 –
see <MineClone2/MineClone2#2099> for
further details. I have not verified that but I noticed that in commit
152e552458 the file was replaced with a
file containing the exact same pixels.

A visual inspection confirms that the file contains noise, so it is not
clear if it is even copyrightable. However, to ensure that it could not
be identical to a file from Minecraft, To get noise of the same quality,
I have shuffled all its pixels with the following POSIX sh shell script:

LANG=C
PREFIX=mcl_end_crystal_beam
convert $PREFIX.png $PREFIX.pnm
<$PREFIX.pnm  >$PREFIX.plainpnm pnmtoplainpnm
<$PREFIX.plainpnm >$PREFIX.seed tr '1234567890 ' ' 1356902468'
(
 <$PREFIX.plainpnm head -n+3
 <$PREFIX.plainpnm tail -n+4 \
  |tr ' ' '\n' \
  |shuf --random-source $PREFIX.seed
) >$PREFIX.shuffled.plainpnm

I then opened mcl_end_crystal_beam.shuffled.plainpnm using GIMP,
converted the color black to tranparency and saved the image as a
paletted PNG (which yields a smaller filesize than a grayscale PNG).
2022-04-16 01:24:04 +02:00
cora e63e3b3cbd Merge pull request 'Make shields work with all mobs' (#2107) from shield_mob_fixes into master
Reviewed-on: MineClone2/MineClone2#2107
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-04-12 10:31:31 +00:00
NO411 2aa04519dd Merge branch 'shield_mob_fixes' of https://git.minetest.land/MineClone2/MineClone2 into shield_mob_fixes 2022-04-09 16:21:32 +02:00
NO411 e790bf90f4 Make shields work with all mobs 2022-04-09 16:21:22 +02:00
NO411 b108f58b2f NO11 2022-04-09 16:19:53 +02:00
cora 8e904e2ca9 Merge pull request 'mcl_weather: fix typo/crash' (#2105) from fix_weather_typo into master
Reviewed-on: MineClone2/MineClone2#2105
Reviewed-by: NO11 <no11@noreply.git.minetest.land>
2022-04-08 15:03:06 +00:00
cora bb593159f1 mcl_weather: fix typo/crash 2022-04-08 06:23:14 +02:00
cora 83c91aba93 Merge pull request 'Shields: Fix crash when deflecting ghast fireball ( #2095 )' (#2103) from fix-shield-ghast-crash into master
Reviewed-on: MineClone2/MineClone2#2103
Reviewed-by: NO11 <no11@noreply.git.minetest.land>
2022-04-07 20:47:56 +00:00
cora e7970ecce5 shields: Fix crash when deflecting ghast fireball 2022-04-07 22:40:48 +02:00
kabou b96fb2af17 Merge pull request 'Replace mcl_end_crystal_beam.png with free version.' (#2100) from end_crystal_beam into master
Reviewed-on: MineClone2/MineClone2#2100
2022-04-06 21:22:57 +00:00
kabou 152e552458 Replace mcl_end_crystal_beam.png with free version.
* Replace mcl_end_crystal_beam.png with unknown provenance with a
  version from the PixelPerfection texture pack that has a know good
  free licence.
2022-04-06 23:04:01 +02:00
cora f807ac5c70 Merge pull request 'Remove `settlements_in_world` and `settlements.txt`' (#2094) from villages-fixes into master
Reviewed-on: MineClone2/MineClone2#2094
2022-04-02 20:32:21 +00:00
kabou ace0dc00c7 Remove `settlements_in_world` and `settlements.txt`
The global(!) table settlements_in_world` has no use, but is serialized and
saved to a file `settlements.txt` every time during generation of a new
village, adding more lag.  This commit removes all related code:
* Remove all instances of `settlements_in_world`.
* Remove `settlements.load()` and `settlements.save()`.
2022-04-02 21:52:03 +02:00
cora 85d1f61188 Merge pull request 'More composters fixes and updates.' (#2093) from composters into master
Reviewed-on: MineClone2/MineClone2#2093
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-04-02 02:01:34 +00:00
kabou f3b28df6cc Rework function comments.
* Move descriptive function comments to above the function definition.
* Adopt some luadoc styles.
* Update a stale reference to a renamed function in comments.
2022-04-02 03:32:56 +02:00
kabou f37f8b6bca Return itemstack in `composter_harvest()`.
* `composter_harvest()` is a `on_rightclick` handler and should return
  what remains of the ItemStack that was passed to it.
2022-04-02 03:32:56 +02:00
kabou 2ba801dfc7 Add protection support to composter.
* Add checks for `minetest.is_protected()` and log any violations.
* Add local aliases for global functions.
2022-04-02 03:32:56 +02:00
kabou bba3aabb59 Add `compostability` to GROUPS.md 2022-04-02 03:32:56 +02:00
kabou 19eb31f389 Streamline use of vector ops.
* Use vector.offset instead of vector.add.
* Define and use local alias for vector.offset.
2022-04-02 03:32:56 +02:00
kabou 541a805a48 Logix fix and some simple optimizations.
* Fix silly and mostly inconsequential logic bug that had gone unnoticed up
  till now.
* Condense a single use variable away by using a slightly more elaborate
  assignment statement.
* Add a few more local aliases for global minetest.* functions.
2022-04-02 03:32:56 +02:00
kabou cd12e1d78c Various little fixes.
* Remove trailing whitespace.
* Remove `use_texture_alpha` setting from node definitions, the default
  value is already the correct one.
2022-04-02 03:32:56 +02:00
kabou 4335d0d659 Use compostability group from node definitions.
* Replace use of local table with compostability values with a call to
 `minetest.get_item_group()`.
* Define local alias for `minetest.get_item_group`.
* Remove the now unused static compostabilty values table.
2022-04-02 03:32:56 +02:00
kabou de16eb3c5a Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-04-02 03:32:56 +02:00
cora 6851fa759e Merge pull request 'Fix weather lag' (#2091) from fix-weather-lag into master
Reviewed-on: MineClone2/MineClone2#2091
2022-03-30 10:25:44 +00:00
cora 7f1bb7af92 replace nether dust particles with p. spawners
mcl2 uses add_particle for nether dust resulting in a 10-fold
increase in network traffic when in the nether. Nether dust is not
configurable making it impossible to turn this off for server admins.
this commit replaces the add_particle method with particle spawners
2022-03-30 10:21:32 +00:00
cora 53715212a2 remove unnecessary on_dimensionchange 2022-03-30 10:21:32 +00:00
cora c146426c5c fix snow not being properly removed 2022-03-30 10:21:32 +00:00
cora dc24f45cfa add indoor detection for snow 2022-03-30 10:21:32 +00:00
cora d2861c5955 remove unneccessary particle logic 2022-03-30 10:21:32 +00:00
cora 1e4494e85d let rain and thunder use particlespawners 2022-03-30 10:21:32 +00:00
cora 4eae95fa47 let snow use particlespawners 2022-03-30 10:21:32 +00:00
cora ef7ebda90c Merge pull request 'fire-HUD-crashfix' (#2093) from fire-HUD-crashfix into master
Reviewed-on: MineClone2/MineClone2#2093

Tested and verified it fixes the crash
2022-03-30 10:20:24 +00:00
kabou 1b99b73894 Fix wrong player name accessor.
* Duh..
2022-03-30 01:31:38 +02:00
kabou 14da059ce7 Add extra check and warning on missing player data.
* For some unexplained reason, `mcl_burning.storage[player]` can
  sometimes be `nil`, causing a crash in `on_leaveplayer()`.  This
  commit adds a check for that.  If a `nil` is encountered, a sane
  value is substituted and a warning is set to the log.
2022-03-29 12:06:00 +02:00
cora 04f0ea260d Merge pull request 'Add shields and offhand (Fix #295)' (#2073) from NO11/MineClone2:shields2 into master
Reviewed-on: MineClone2/MineClone2#2073
Reviewed-by: AFCMS <afcm.contact@gmail.com>
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-28 14:55:11 +00:00
NO11 5974b6f609 Merge branch 'master' into shields2 2022-03-28 12:27:57 +00:00
NO411 148be4ea39 Fix shield behavior 2022-03-27 19:52:36 +02:00
NO411 6afe7cfb58 Fix typo and interact bug? 2022-03-27 18:08:43 +02:00
cora 8e24e6edfe Merge pull request 'Fix Barrel protection and add proper log for interactions (#2086)' (#2087) from barrel_fix into master
Reviewed-on: MineClone2/MineClone2#2087
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-25 13:16:52 +00:00
AFCMS 909b77ce4d
barrel protection fix + log 2022-03-25 13:28:33 +01:00
cora 1dde51dd0b Merge pull request 'Fix passive mobs not spawning in certain biomes ( #2069 )' (#2085) from fix-mobs-spawning into master
Reviewed-on: MineClone2/MineClone2#2085
2022-03-24 16:00:24 +00:00
NO11 63a156c30c Fix typo/crash 2022-03-23 18:30:34 +00:00
cora 1c9f0c3238 don't spawn mobs on non opaque nodes or leaves
with the preliminary jordanspaning mobs would spawn on trees
and water regularly.
2022-03-22 22:02:15 +01:00
cora 50e99f470e fix certain mobs not spawning in certain biomes 2022-03-22 15:16:48 +01:00
NO411 aeff7cf1a4 Remove offhand item on death 2022-03-22 12:48:41 +01:00
cora bc723616ea Merge pull request 'Fix undefined luaentity crash.' (#2084) from fix-unregistered-collisions into master
Reviewed-on: MineClone2/MineClone2#2084
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-21 10:31:20 +00:00
kabou 46ee5aaa59 Fix undefined luaentity crash.
* Add nil check to get_luaentity() access.
* Cache get_luaentity() call in local var.
2022-03-21 01:39:02 +00:00
cora 3dd4eec4e8 Merge pull request 'Add `group:supported_node` (for carpets).' (#2077) from kabou/MineClone2:add-group-supported_nodes into master
Reviewed-on: MineClone2/MineClone2#2077
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-21 00:31:53 +00:00
NO411 019dd45381 Check for damager 2022-03-19 16:50:19 +01:00
NO411 d481f7b720 Fix showing shield hud at the wrong side for half a second 2022-03-19 15:59:59 +01:00
NO411 c94964d10a Remove debug line 2022-03-19 15:26:41 +01:00
kabou a9a3f01a0e Tiny comment fix. 2022-03-19 03:16:15 +01:00
kabou ae6bea73fd Make carpets `supported_node`.
* Change carpet from `group:attached_node` to `group:supported_node`,
  allowing carpets to be placed on top of torches, water source blocks
  and other non-walkable nodes, like in MC.
2022-03-19 02:32:46 +01:00
kabou 2002872af8 Add group `supported_node` to GROUPS.md. 2022-03-19 02:32:29 +01:00
kabou 8518ce2c19 Add support for `group:supported_node`
* Add support for `group:supported_node` to CORE/mcl_attached.
  Supported nodes are nodes that can be placed on any node that does not
  have the `drawtype = "airlike"` attribute.
* Copy the `drop_attached_node()` function from minetest/builtin, so
  that the override function provides the same behavior when nodes drop.
* Add comments to CORE/mcl_attached and to the functions defined in it.
* Add more local aliases for global minetest.* functions.
* If the original function returns true, it is not necessary anymore
  to perform more tests and the override function can simply return true
  immediately.
2022-03-19 02:32:13 +01:00
NO411 6158e4e50d Don't always update shield texture using set_properties 2022-03-18 23:23:01 +01:00
NO411 7c0a48bebf Remove some code ... 2022-03-18 23:08:50 +01:00
NO411 5bdf83cbfc Revert weird changes 2022-03-18 23:07:25 +01:00
NO411 976cfba53a Make it possible to xraft a banner on an enchanted shield 2022-03-18 23:02:51 +01:00
NO411 fc9e83c059 Make it possible to craft a banner on an enchanted shield 2022-03-18 23:02:25 +01:00
NO411 60d877b718 Fix enchanting shield on enchanting table possible 2022-03-18 22:45:12 +01:00
cora 81a1b9973a Merge pull request 'More burning HUD fixes (kabou)' (#2076) from fix-burning-hud into master
Reviewed-on: MineClone2/MineClone2#2076
2022-03-18 10:52:07 +00:00
kabou 9eba0e4860 Remove unused code.
* Remove unused code that was commented out.  The code tried to find
  fire luaentities in the same spot as the newly created fire luaentity.
  It may have been intended to optimize getting set on fire multiple
  times, but it makes no sense as it does not discriminate between fire
  luaentities attached to the object set on fire and those attached to
  other objects.  The function that this code was in also has a better
  way to prevent adding multiple fire luaentities in the first place.
2022-03-18 11:39:11 +01:00
kabou 90311da514 Preempt possible crash on nil in on_joinplayer.
* In mineclone5 a crash was reported to occur when deserialization of
  storage returned nil in on_joinplayer.    https://git.minetest.land/
  MineClone5/MineClone5/commit/96c4fb60d8641b4181edb902ed24dbf173828d09
  This commit uses a different, but equally effective fix.
2022-03-18 11:36:33 +01:00
kabou e9ff2ba32a Minor changes to mcl_burning.
* Remove animation_frame from fire entity state, it is now kept in the
  storage table of the parent entity.
* Rename animation_timer in fire entity table to _mcl_animation_timer,
  in line with mineclone2 policy on adding custom members to minetest
  tables.
* Comment out code that does nothing sensible.  Scheduled for deletion
  at a later time.
2022-03-18 11:36:23 +01:00
cora 0b89149fe2 Merge pull request 'Update readme to reflect correct MT version, bump version to 0.73 (dev)' (#2074) from fix_readme_compat into master
Reviewed-on: MineClone2/MineClone2#2074
2022-03-17 21:07:44 +00:00
cora 7df6c8739e update version to 0.73.0 (in development) 2022-03-16 12:48:02 +01:00
cora cd725137ae update readme to reflect correct MT version 2022-03-16 12:38:04 +01:00
NO411 0f8f5a41d2 Fix dependencies 2022-03-15 16:30:03 +01:00
NO411 db68c0e26b Add shield 2022-03-15 15:58:27 +01:00
NO11 627da6d305 Merge pull request 'master' (#16) from MineClone2/MineClone2:master into master
Reviewed-on: NO11/MineClone2#16
2022-03-15 14:22:26 +00:00
cora 1803cc560d Merge pull request 'Remove stray work notes files.' (#2071) from delete-temp-notes into master
Reviewed-on: MineClone2/MineClone2#2071
2022-03-15 11:05:46 +00:00
kabou 3f787f8305 Remove stray work notes files.
* These temp files accidentally got added during the unregistered nodes
  fixes.
2022-03-15 07:42:11 +01:00
epCode 9534624b21 Merge pull request 'fix #2068' (#2070) from epcode-patch-1 into master
Reviewed-on: MineClone2/MineClone2#2070
2022-03-15 02:18:32 +00:00
epCode 4483f4b6b6 fix #2068 2022-03-15 02:18:02 +00:00
cora d3bfdb190e Merge pull request 'Fix frost walker enchant not protecting from magma block damage (#2064)' (#2065) from frost_walker_fix into master
Reviewed-on: MineClone2/MineClone2#2065
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-13 19:03:06 +00:00
AFCMS 47b1eeda74
fix frost walker enchant not protecting from magma block damage 2022-03-13 19:11:28 +01:00
cora ba0e2cbf29 Merge pull request 'item pickup sound gain more MC like' (#2054) from pepebotella/MineClone2:pop_sound into master
Reviewed-on: MineClone2/MineClone2#2054
2022-03-13 14:08:48 +00:00
Freedom f430aec0cd
item pickup sound gain more MC like 2022-03-13 14:58:01 +01:00
NO11 a44846a82c Merge pull request 'master' (#15) from MineClone2/MineClone2:master into master
Reviewed-on: NO11/MineClone2#15
2022-03-12 22:42:24 +00:00
cora 22edd08387 Merge pull request 'Make carpets walkable.' (#2060) from fix-carpets-walkable into master
Reviewed-on: MineClone2/MineClone2#2060
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-12 13:37:29 +00:00
kabou 17b8eab368 Make carpets walkable.
* Make carpets walkable.  When a carpet is placed on top of a fence or a
  wall, the carpet can be jumped upon, allowing to in effect jump over
  fences and walls.
2022-03-12 13:35:12 +00:00
cora 119b4aa82c Merge pull request 'Update version and credits for release' (#2059) from update_docs_for_073 into master
Reviewed-on: MineClone2/MineClone2#2059
Reviewed-by: AFCMS <afcm.contact@gmail.com>
Reviewed-by: NO11 <no11@noreply.git.minetest.land>
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
2022-03-11 11:47:03 +00:00
cora 181c3f0c0f Remove kay27 from (previous) maintainers 2022-03-10 21:28:37 +01:00
cora 21e7ab1f2a Update mcl5 contributors, add mineclonia 2022-03-10 19:04:00 +01:00
cora 6f284c0c95 Update Credits 2022-03-10 19:04:00 +01:00
cora e0801ba7e4 Remove in development from readme 2022-03-10 19:03:06 +01:00
cora 267031793d Merge pull request 'Fix composters, & barrels not being able to be used as smelting fuel.' (#2057) from make_barrels_composters_furnace_fuel into master
Reviewed-on: MineClone2/MineClone2#2057
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-10 11:31:32 +00:00
MysticTempest de3cdee09e Make composters & barrels fuel for furnaces with the same burntime as chests. 2022-03-10 00:47:54 -06:00
cora c5993a60ae Merge pull request 'Fix daylight sensor.' (#2041) from fix-daylight-sensor into master
Reviewed-on: MineClone2/MineClone2#2041
2022-03-09 22:50:29 +00:00
Nils Dagsson Moskopp 77f8ecd6e8 Make daylight detector work in Minetest 5.3.0
This patch contains a function that searches for a path to a node with
light level 15, which is guaranteed to be sunlight.
2022-03-09 22:33:08 +00:00
Nils Dagsson Moskopp 4da5084daf Make daylight detector ignore artificial light
The daylight detector code used get_node_light(), which detects both
natural and artificial light. This patch improves the code to use
get_natural_light(), which was introduced with Minetest 5.4.0.
2022-03-09 22:33:08 +00:00
cora dca653651c Merge pull request 'Fix potential crashes due to unregistered nodes.' (#2055) from fix-unregistered-nodes into master
Reviewed-on: MineClone2/MineClone2#2055
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-09 22:16:27 +00:00
kabou deed231f28 Fix typos. 2022-03-09 18:50:41 +01:00
kabou 11ee1d133f Fix cut-n-paste error.
* Swap misplaced lines.
* Concatenate conditional expression.
2022-03-09 18:26:51 +01:00
kabou 1326b9e7e7 Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.  By application of De Morgan's law, the compound logic
  expression can be rewritten so that the existence of the table is
  checked before all following attribute references.
2022-03-09 15:14:22 +01:00
kabou 6a69f49fa0 Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
2022-03-09 14:59:49 +01:00
kabou f5a8d6d17a Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
* Clarify code flow.
2022-03-09 14:40:37 +01:00
kabou 3f4dafc68f Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
2022-03-09 14:14:45 +01:00
kabou 9bac0da01a Fix registered_items oddity and add check for unknown nodes.
* Mobs redo uses `registered_items[]` where clearly the proper table
  accessed should be `registered_nodes[]`.  Perhaps this magically
  works, but it looks nonsensical.  Switch to the use the more
  sensible `registered_nodes[]` table.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
2022-03-09 13:11:53 +01:00
kabou 818cbb2f48 Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
2022-03-09 12:11:59 +01:00
kabou 88f7a150c7 Add check for unknown nodes.
* Add check for unknown node in `handle_node_drops()` and return
  immediately if the dug node has no definition table.
2022-03-09 04:00:48 +01:00
kabou 962500b189 Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
2022-03-09 02:23:18 +01:00
kabou 95cfa43483 Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
2022-03-09 02:15:33 +01:00
kabou 4a1b93bbfa Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
2022-03-09 02:05:38 +01:00
kabou b9c2c3bd0a Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
* Reduce redundant `== false` condition check.
2022-03-09 00:01:23 +01:00
cora 52333cea0f Merge pull request 'ITEMS/mcl_anvils: fix renaming items without description' (#1914) from fix-anvil-renaming into master
Reviewed-on: MineClone2/MineClone2#1914
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
2022-03-07 01:43:47 +00:00
Dieter44 f8c60b5f75 ITEMS/mcl_anvils: fix renaming items w/o desc… 2022-03-05 15:35:39 +00:00
cora bcf302ceb0 Merge pull request 'Rename a few textures to help support texture packs.' (#2045) from MysticTempest/MineClone2:Texture_pack_support into master
Reviewed-on: MineClone2/MineClone2#2045
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-03-05 02:57:00 +00:00
MysticTempest 7a53ea8b70 Rename a few textures to help support texture packs. 2022-03-02 20:13:24 -06:00
cora e8ff33a741 Merge pull request 'Alternative solution to fix crash on nether portal destruction' (#2029) from ryvnf-portal-removal into master
Reviewed-on: MineClone2/MineClone2#2029
2022-03-03 01:51:49 +00:00
Elias Åström 3c10f0e970 Rewrite portal removal to avoid stack overflow
This solves a problem were nether portal removal would trigger deep
recursion through node callbacks.  For large portals this could result
in stack overflow crashes on LuaJIT.  The issue is solved by rewriting
the portal removal to avoid recursion and removing the portal in one
operation using minetest.bulk_set_node.
2022-03-03 01:42:49 +00:00
cora f7d712543f Merge pull request 'Fix fire HUD' (#2042) from kabou/MineClone2:fix-burning-HUD into master
Reviewed-on: MineClone2/MineClone2#2042
2022-03-03 01:40:05 +00:00
kabou c3e0996902 Fix fire HUD not showing on join while burning.
* Add the fire HUD to a player who joins the server while still burning
  from the previous session.
2022-03-02 17:15:05 +01:00
kabou d424d4f10e Add comments to mcl_burning.update_hud(). 2022-03-02 16:39:27 +01:00
kabou e80006f4ea Do not set fire to objects that are already burning.
Changes to mcl_burning.set_on_fire():
* Add logic that only updates the burn time, but skips adding fire
  entities to objects that are already burning.
* Condense code a little, remove single use variables.
* Add a comment to a questionable piece of code.
* Add comments to the function.
2022-03-02 16:25:40 +01:00
kabou b17776699e Add comments to "storage" table.
* Document attributes of the "storage" table.
2022-03-02 15:40:29 +01:00
kabou 86a4ece7d2 Add local copy of minetest.find_nodes_in_area. 2022-03-02 15:25:03 +01:00
kabou df5d24104d Make player burning HUD work without csm.
* Add update_hud() function.
* Remove the client channels.
* Unglobalize animation_frames variable.
* Fix bug where player state was not stored on shutdown of singleplayer
  game.
* Remove superfluous sanity_check() function, this code could easily be
  inlined in its only caller.
2022-03-02 15:21:55 +01:00
cora 8dd540269c Merge pull request 'Fix burning entity animation.' (#2039) from kabou/MineClone2:fix-burning-entities into master
Reviewed-on: MineClone2/MineClone2#2039
2022-03-02 11:34:37 +00:00
kabou 56b63463a5 Fix burning entity animation.
The parameters for the flames sprite were incorrect, causing the reverse
side of the sprite to appear as an opaque black rectangle.  Use the
correct incantation.
2022-03-02 10:47:46 +01:00
cora c2ae28aec1 Merge pull request 'Fix TGA file writing on Windows' (#1985) from fix-tga-file-writing-on-windows into master
Reviewed-on: MineClone2/MineClone2#1985
Reviewed-by: AFCMS <afcms@noreply.git.minetest.land>
2022-02-28 17:10:51 +00:00
Nils Dagsson Moskopp 66bb209ad1 Fix TGA file writing on Windows
Before this patch, the tga_encoder mod would write corrupted TGA files
on Windows: Bytes that looked like newlines were replaced by a carriage
return and a newline.
2022-02-28 16:58:59 +00:00
cora a3e01e6dbe Merge pull request 'Add Target' (#2033) from AFCMS/MineClone2:target into master
Reviewed-on: MineClone2/MineClone2#2033
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-02-27 17:25:16 +00:00
AFCMS 5a7b1cc382
make all arrow types activate target (+ depends and code fixes) 2022-02-26 23:52:03 +01:00
AFCMS 210a0d8ee1
make lingering potions activate target (+ indentation fix) 2022-02-26 22:44:50 +01:00
AFCMS eae8effd57
make splash potions activate target 2022-02-26 22:42:27 +01:00
AFCMS b51e322304
make fire charges activate target (+ fix possible crash) 2022-02-26 22:38:34 +01:00
AFCMS 096d46152e
make bottle o enchanting activate target 2022-02-26 22:20:05 +01:00
AFCMS d89687984b
make ender pearls activate target 2022-02-26 22:16:10 +01:00
AFCMS c6f72c473f
make eggs activate target 2022-02-26 22:12:26 +01:00
AFCMS 540b72f1d6
add target help text 2022-02-26 19:12:02 +01:00
AFCMS 7449725a56
add target crafting receipe 2022-02-26 19:12:01 +01:00
AFCMS 9e7a525a0a
make snowballs activate target 2022-02-26 19:12:01 +01:00
AFCMS 4bd91750bc
add target with API 2022-02-26 19:12:01 +01:00
cora 8e1a9e1785 Merge pull request 'mapgen/mcl_mapgen_core: move set_node decorations a node callback' (#2028) from fix-nether-wart into master
Reviewed-on: MineClone2/MineClone2#2028
2022-02-25 21:28:40 +00:00
E 87e494f42b 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)
2022-02-25 18:38:50 +01:00
cora dfed21ee14 Merge pull request 'Revert mob rewrite' (#1992) from revert-to-oldmobs into master
Reviewed-on: MineClone2/MineClone2#1992
2022-02-25 16:47:47 +00:00
cora 3feca330c9 fix the other 2 throw_xp occurences 2022-02-25 00:40:26 +00:00
cora caacb378de fix api change in enchanting 2022-02-25 00:40:26 +00:00
cora 379972ea11 fix crash when blaze attacks logged off player 2022-02-25 00:40:26 +00:00
cora 414e2e7725 fix crash on opening villager formspec 2022-02-25 00:40:26 +00:00
cora 435b5d756d throw_experience->throw_xp (api change) 2022-02-25 00:40:26 +00:00
cora 2bb416765c revert to old mobs ( 32c03dc27e )
This reverts the hierarchies ENTITIES/mcl_mobs, ENTITIES/mobs_mc
and ENTITIES/mobs_mc_gameconfig to the state of commit
32c03dc27e
2022-02-25 00:40:26 +00:00
cora 02361b2d01 Merge pull request 'ITEMS/mcl_fire: fix laggy fire spread' (#1998) from fix-fire into master
Reviewed-on: MineClone2/MineClone2#1998
2022-02-25 00:17:47 +00:00
cora 86ca401e4e do not randomseed twice 2022-02-25 00:08:26 +00:00
cora 378b5b30c9 fix beds dropping when burning up 2022-02-25 00:08:26 +00:00
cora 840b705a22 make fire use abms instead of laggy node timers 2022-02-25 00:08:26 +00:00
cora 80c79dde1c Merge pull request 'Fix handheld maps not displaying in Minetest 5.5.0' (#2010) from fix-mcl-maps-in-minetest-5.5 into master
Reviewed-on: MineClone2/MineClone2#2010
2022-02-24 22:47:26 +00:00
Nils Dagsson Moskopp 27842aa2f5 Fix handheld maps not displaying in Minetest 5.5.0
The function dynamic_add_media() was changed in incompatible ways in
several minor versions of Minetest, breaking the display of handheld
maps in Minetest 5.5.0. This patch makes handheld maps display there.

The function was blocking with one argument in Minetest 5.3. It was also
blocking in Minetest 5.4, but took an additional argument for a function
to execute once the media had been received. Calling dynamic_add_media()
with a single argument had been deprecated; a function that did nothing
was provided in mcl_maps to satisfy the changed argument requirements.

In Minetest 5.5, dynamic_add_media() was changed to non-blocking. This
introduced a race condition in mcl_maps, where a client often tried to
display a map before it had received the map texture from the server.

Opening an issue on the Minetest issue tracker led to it being closed in
about 20 minutes: <https://github.com/minetest/minetest/issues/11997>
2022-02-24 22:43:45 +00:00
cora 85e0e23c76 Merge pull request 'Fix redstone comparator flooding crash by erlehmann' (#2027) from fix-comparator-crash into master
Reviewed-on: MineClone2/MineClone2#2027
2022-02-24 21:35:12 +00:00
Nils Dagsson Moskopp 41550da87b 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-24 15:52:01 +01:00
cora a4e541bcd2 Merge pull request 'remove blend1 file / add blend1 files to gitignore (fix #2015)' (#2024) from AFCMS/MineClone2:remove-blend1 into master
Reviewed-on: MineClone2/MineClone2#2024
Reviewed-by: Nicu <kneekoo@noreply.git.minetest.land>
2022-02-24 14:48:51 +00:00
AFCMS 89a930ace3
add `.blend2` and `.blend3` files to gitignore 2022-02-24 10:16:48 +01:00
AFCMS 129117efb3
add `.blend1` files to gitignore 2022-02-24 10:16:47 +01:00
AFCMS cbfc71705d
remove blender backup file 2022-02-24 10:16:47 +01:00
cora 4b89398b3b Merge pull request 'Fix hopper breakage in get_item_group return value. (Fixes: #2022)' (#2023) from kabou/MineClone2:fix-hoppers into master
Reviewed-on: MineClone2/MineClone2#2023
Reviewed-by: AFCMS <afcms@noreply.git.minetest.land>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-02-24 02:23:09 +00:00
kabou 5431e206b0 Fix hopper breakage in get_item_group return value.
In commit 55009c257e that added vectors to
mcl_composters, mcl_hoppers was accidentally patched with a unrelated
change, updating it to get_item_group().  This mostly works, but in one
particular case the semantics of the return value differs.  Instead of
returning 'nil' it returns '0'.  That altered the evaluation of an if
condition, breaking the abm that sucks in items.

This commit fixes the conditional by explicitly comparing  '~= 0'.
2022-02-24 03:18:25 +01:00
cora c60fd92638 Merge pull request 'Traditional chinese by emojigit (partial)' (#2026) from emojigit-zh-trans into master
Reviewed-on: MineClone2/MineClone2#2026
2022-02-23 23:29:52 +00:00
1F616EMO 06deb92dd6 mcl_tools 2022-02-23 23:58:05 +01:00
1F616EMO 7685b4758f mcl_flowers 2022-02-23 23:58:05 +01:00
1F616EMO 9944abb328 mcl_books 2022-02-23 23:58:05 +01:00
1F616EMO 5ce1852c1d mcl_dye 2022-02-23 23:58:05 +01:00
1F616EMO 56a70025b8 mcl_flowerpots 2022-02-23 23:58:05 +01:00
1F616EMO 9fe3bbd2fa mcl_mushrooms 2022-02-23 23:58:05 +01:00
1F616EMO fb1d189d40 mcl_doors 2022-02-23 23:58:05 +01:00
1F616EMO 9cd24f4af5 mcl_commands 2022-02-23 23:58:05 +01:00
1F616EMO a64c3f87bc xpanes 2022-02-23 23:58:05 +01:00
1F616EMO 5075f2ca56 mcl_armor 2022-02-23 23:58:05 +01:00
1F616EMO 249dfac319 mcl_inventory 2022-02-23 23:58:05 +01:00
1F616EMO 2b5a0242db mcl_fire 2022-02-23 23:58:05 +01:00
1F616EMO 790ccf0812 mcl_fishing 2022-02-23 23:58:05 +01:00
1F616EMO 8d639794f3 mcl_fences 2022-02-23 23:58:05 +01:00
1F616EMO af8681c143 mcl_buckets 2022-02-23 23:58:05 +01:00
1F616EMO 1ef58f7250 mcl_walls 2022-02-23 23:58:05 +01:00
1F616EMO 15747220f2 mcl_hoppers 2022-02-23 23:58:05 +01:00
1F616EMO 925dad7f5e mcl_anvils 2022-02-23 23:58:05 +01:00
1F616EMO 729f653c85 mcl_portals 2022-02-23 23:58:05 +01:00
1F616EMO d1e328e57a mcl_bows 2022-02-23 23:58:05 +01:00
1F616EMO 615a968fbb mcl_skins 2022-02-23 23:58:05 +01:00
1F616EMO 7e5a9bd8b6 mcl_throwing 2022-02-23 23:58:05 +01:00
1F616EMO d018bee00a mcl_cake 2022-02-23 23:58:05 +01:00
1F616EMO 1365d0b257 mcl_jukebox 2022-02-23 23:58:05 +01:00
1F616EMO a289a00427 mcl_heads 2022-02-23 23:58:05 +01:00
1F616EMO a238aabbb0 mcl_cauldrons 2022-02-23 23:58:05 +01:00
1F616EMO b02f7cd974 mcl_mobs 2022-02-23 23:58:05 +01:00
1F616EMO e19113d4e0 findbiome 2022-02-23 23:58:05 +01:00
1F616EMO 4deac632e6 mcl_sponges 2022-02-23 23:58:05 +01:00
1F616EMO c480e6891d mcl_maps 2022-02-23 23:58:05 +01:00
1F616EMO 844eb3fb7c mcl_brewing 2022-02-23 23:58:05 +01:00
1F616EMO fc768cb1ad mcl_signs 2022-02-23 23:58:05 +01:00
1F616EMO 1f9a919459 mcl_monster_eggs 2022-02-23 23:58:05 +01:00
1F616EMO 70007e3453 mcl_furnaces 2022-02-23 23:58:05 +01:00
1F616EMO 3aff1f8981 mcl_hunger 2022-02-23 23:58:05 +01:00
1F616EMO c86a506672 mcl_tnt 2022-02-23 23:58:05 +01:00
1F616EMO f348223da2 mcl_crafting_table 2022-02-23 23:58:05 +01:00
1F616EMO ca6469b959 mcl_weather 2022-02-23 23:58:05 +01:00
1F616EMO c52e09ddcd mcl_structures 2022-02-23 23:58:05 +01:00
1F616EMO bb55120adc mcl_experience 2022-02-23 23:58:05 +01:00
1F616EMO 77339afbe2 mcl_cocoas 2022-02-23 23:58:05 +01:00
1F616EMO 9b15599bee hudbars 2022-02-23 23:58:05 +01:00
1F616EMO a685c3bc83 mclx_core 2022-02-23 23:58:05 +01:00
1F616EMO b01d4eba88 mcl_paintings 2022-02-23 23:58:05 +01:00
1F616EMO 952747d4da mcl_mobspawners 2022-02-23 23:58:05 +01:00
1F616EMO 430f5b05ab mcl_itemframes 2022-02-23 23:58:05 +01:00
1F616EMO e4a311e28a mcl_clock 2022-02-23 23:58:05 +01:00
1F616EMO 6a115a68ef mcl_armor_stand 2022-02-23 23:58:05 +01:00
1F616EMO f3d0ec845c mcl_spawn 2022-02-23 23:58:05 +01:00
1F616EMO 563daeed8a mcl_wip 2022-02-23 23:58:05 +01:00
1F616EMO a6c3cab791 mclx_fences 2022-02-23 23:58:05 +01:00
1F616EMO bb4ddee570 mcl_compass 2022-02-23 23:58:05 +01:00
1F616EMO fe3e80bc0e lightning 2022-02-23 23:58:05 +01:00
1F616EMO 59fe078fd7 mcl_playerplus 2022-02-23 23:58:05 +01:00
1F616EMO dba08ddc1f mcl_torches 2022-02-23 23:58:05 +01:00
1F616EMO 551bf917e2 mcl_void_damage 2022-02-23 23:58:05 +01:00
1F616EMO 26dadb1846 mcl_falling_nodes 2022-02-23 23:58:05 +01:00
1F616EMO 33a353e20d mcl_privs 2022-02-23 23:58:05 +01:00
1F616EMO f02f3c9f40 screwdriver 2022-02-23 23:58:05 +01:00
1F616EMO 410c1ecd1f mcl_hbarmor 2022-02-23 23:58:05 +01:00
1F616EMO ba172f0847 mcl_explosions 2022-02-23 23:58:05 +01:00
1F616EMO ad42c3588b mcl_farming 2022-02-23 23:58:05 +01:00
1F616EMO 9734c74c56 (WIP) mcl_farming 2022-02-23 23:58:05 +01:00
1F616EMO c3dd5e6c2c MORE MESS SORRY XD 2022-02-23 23:58:05 +01:00
1F616EMO 21808390f9 Revert "add translates for `mcl_boats`"
This reverts commit 2ee84f2ad3bd1f067a43c9382d7fc70f30fab9f0.
2022-02-23 23:58:05 +01:00
1F616EMO cc87791327 add translates for `mcl_boats`
Co-authored-by: Emojigit <emojigit@noreply.git.minetest.land>
2022-02-23 23:58:04 +01:00
1F616EMO f8cd01a15e add translate of README.md 2022-02-23 23:58:04 +01:00
1F616EMO a8aabb2329 add translate for `doc_identifier` 2022-02-23 23:58:04 +01:00
1F616EMO 4f00b62a18 add zh_TW translate to `mcl_beds` and `mcl_core` 2022-02-23 23:58:04 +01:00
cora 97412b139a Merge pull request 'Add @epCode logo (fix #1955)' (#2021) from AFCMS/MineClone2:epCode-logo into master
Reviewed-on: MineClone2/MineClone2#2021
2022-02-23 17:55:50 +00:00
AFCMS ceb27b6929
obtimize icons again
`optipng -strip all -o9`
2022-02-23 16:30:08 +01:00
AFCMS b2614f8d78
make menu icon smaller (128x) 2022-02-23 16:30:07 +01:00
AFCMS 84596b2ebb
add @epCode logo 2022-02-23 16:30:07 +01:00
cora 6bb6966752 Merge pull request 'Add Barrel' (#1977) from AFCMS/MineClone2:barrels into master
Reviewed-on: MineClone2/MineClone2#1977
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-02-22 19:38:04 +00:00
AFCMS 360a1604ba
Revert "move barrels to mcl_chests"
This reverts commit a272322cb5.
2022-02-22 20:20:21 +01:00
AFCMS 61f4c5b885
apply @kay27 fix to `mcl_util.drop_items_from_meta_container` 2022-02-22 18:08:26 +01:00
AFCMS a272322cb5
move barrels to mcl_chests 2022-02-22 18:08:25 +01:00
AFCMS 9112915ddd
fix barrel top texture rotation 2022-02-22 18:08:25 +01:00
AFCMS 397c243e89
cleanup barrel TODO list 2022-02-22 18:08:25 +01:00
AFCMS c64d0e4558
simplify random dropping position code 2022-02-22 18:08:24 +01:00
AFCMS 61e54ed617
rename `mcl_util.drop_items_container_get` to `drop_items_from_meta_container` 2022-02-22 18:08:24 +01:00
AFCMS 0988637ea1
add barrel tooltip help text 2022-02-22 18:08:24 +01:00
AFCMS b88060dbfb
add doc description to barrels 2022-02-22 18:08:23 +01:00
AFCMS e3e06b4a4b
fix broken tree placement 2022-02-22 18:08:23 +01:00
AFCMS 34b445b04a
fixes 2022-02-22 18:08:22 +01:00
AFCMS d41a836514
add craft 2022-02-22 18:08:22 +01:00
AFCMS 80fb59f9ac
add barrel 2022-02-22 18:08:22 +01:00
cora dae7c22dd9 Merge pull request 'PLAYER/mcl_playerplus: Do not send redundant bone position and properties' (#1990) from fix-playerplus-packetspam into master
Reviewed-on: MineClone2/MineClone2#1990
2022-02-22 17:00:29 +00:00
cora a9357f7380 Do not send redundant bone position and properties 2022-02-22 11:15:56 +00:00
cora dcfbfd67b8 Merge pull request 'Quick fix: Reinstate nil check in on_place_bucket.' (#2018) from kabou/MineClone2:fix-buckets-cauldrons into master
Reviewed-on: MineClone2/MineClone2#2018
Reviewed-by: AFCMS <afcms@noreply.git.minetest.land>
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-02-21 19:54:35 +00:00
kabou af132cc523 Reinstate nil check in on_place_bucket.
* Oops, nil checks on registered_node[name] were erroneously optimized
  away, risking crashes.  Reinstate those checks.
2022-02-21 18:00:56 +01:00
cora a0b5e4dd0b Merge pull request 'fix filling cauldrons with water buckets and some minor refactoring.' (#2011) from kabou/MineClone2:fix-buckets-cauldrons into master
Reviewed-on: MineClone2/MineClone2#2011
Reviewed-by: cora <cora@noreply.git.minetest.land>
2022-02-21 15:18:02 +00:00
3782 changed files with 308 additions and 135317 deletions

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
# Text Editor TMP Files
*.swp
*.blend1
*.blend2
*.blend3

View File

@ -45,11 +45,8 @@ read_globals = {
------
--GENERAL
"default",
"mcljepc_core",
--ENTITIES
"cmi",
--HUD
"sfinv", "sfinv_buttons", "unified_inventory", "cmsg", "inventory_plus",
}
--MAPGEN
"mcljepc_mapgen",
}

97
API.md
View File

@ -1,95 +1,20 @@
# API
## Groups
MineClone 2 makes very extensive use of groups. Making sure your items and objects have the correct group memberships is very important.
Groups are explained in `GROUPS.md`.
## Mod naming convention
Mods mods in MineClone 2 follow a simple naming convention: Mods with the prefix “`mcl_`” are specific to MineClone 2, although they may be based on an existing standalone. Mods which lack this prefix are *usually* verbatim copies of a standalone mod. Some modifications may still have been applied, but the APIs are held compatible.
## Adding items
### Special fields
Items can have these fields:
* `_mcl_generate_description(itemstack)`: Required for any items which manipulate their
description in any way. This function takes an itemstack of its own type and must set
the proper advanced description for this itemstack. If you don't do this, anvils will
fail at properly restoring the description when their custom name gets cleared at an
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
* `_mcl_blast_resistance`: How well this block blocks and resists explosions. Default: 0
* `_mcl_falling_node_alternative`: If set to an itemstring, the node will turn into this node before it starts to fall.
* `_mcl_after_falling(pos)`: Called after a falling node finished falling and turned into a node.
Use the `mcl_sounds` mod for the sounds.
Mods mods in MineCloneJEpC a simple naming convention: Mods with the prefix
“`mcljepc_`” are specific to MineCloneJEpC, although they may be based on an
existing standalone or a mod from a different MineClone fork. Mods which lack
this prefix are verbatim copies of a standalone mod. Some modifications may
still have been applied, but the APIs are held compatible.
## APIs
A lot of things are possible by using one of the APIs in the mods. Note that not all APIs are documented yet, but it is planned. The following APIs should be more or less stable but keep in mind that MineClone 2 is still unfinished. All directory names are relative to `mods/`
### Items
* Doors: `ITEMS/mcl_doors`
* Fences and fence gates: `ITEMS/mcl_fences`
* Stairs and slabs: `ITEM/mcl_stairs`
* Walls: `ITEMS/mcl_walls`
* Beds: `ITEMS/mcl_beds`
* Buckets: `ITEMS/mcl_buckets`
* Dispenser support: `ITEMS/REDSTONE/mcl_dispensers`
## Mobs
* Mobs: `ENTITIES/mcl_mobs`
MineClone 2 uses its own mobs framework, called “Mobs Redo: MineClone 2 Edition” or “MRM” for short.
This is a fork of Mobs Redo [`mobs`] by TenPlus1.
You can add your own mobs, spawn eggs and spawning rules with this mod.
API documnetation is included in `ENTITIES/mcl_mobs/api.txt`.
This mod includes modificiations from the original Mobs Redo. Some items have been removed or moved to other mods.
The API is mostly identical, but a few features have been added. Compability is not really a goal,
but function and attribute names of Mobs Redo 1.41 are kept.
If you have code for a mod which works fine under Mobs Redo, it should be easy to make it work in MineClone 2,
chances are good that it works out of the box.
### Help
* Item help texts: `HELP/doc/doc_items`
* Low-level help entry and category framework: `HELP/doc/doc`
* Support for lookup tool (required for all entities): `HELP/doc/doc_identifier`
### HUD
* Statbars: `HUD/hudbars`
### Utility APIs
* Change player physics: `PLAYER/playerphysics`
* Select random treasures: `CORE/mcl_loot`
* Get flowing direction of liquids: `CORE/flowlib`
* `on_walk_over` callback for nodes: `CORE/walkover`
* Get node names close to player (to reduce constant querying): `PLAYER/mcl_playerinfo`
* Explosion API
* Music discs API
* Flowers and flower pots
### Unstable APIs
The following APIs may be subject to change in future. You could already use these APIs but there will probably be breaking changes in the future, or the API is not as fleshed out as it should be. Use at your own risk!
* Panes (like glass panes and iron bars): `ITEMS/xpanes`
* `_on_ignite` callback: `ITEMS/mcl_fire`
* Farming: `ITEMS/mcl_farming`
* Anything related to redstone: Don't touch (yet)
* Any other mod not explicitly mentioned above
A lot of things are possible by using one of the APIs in the mods. Note that not
all APIs are documented yet, but it is planned. The following APIs should be
more or less stable but keep in mind that MineCloneJEpC is still unfinished. All
directory names are relative to `mods/`
### Planned APIs
* Saplings and trees
* Custom banner patterns
* Custom dimensions
* Custom portals
* Dispenser and dropper support
* Proper sky and weather APIs
* Event-based apis to ensure that specific startup code inside of mods can run
in the correct order

View File

@ -6,10 +6,22 @@
## Creator of MineClone2
* Wuzzy
## Maintainers
* Fleckenstein
## Creator of Minecraftn't Classic
* ROllerozxa
## Creator of Minecraftn't Pre-classic
* ROllerozxa
## Creator of MinecloneJEpC
* Lazerbeak12345
## MCL2 Maintainers
* Nicu
* kay27
* cora
## Previous MCL2 Maintainers
* Fleckenstein
* jordan4ibanez
## Developers
* bzoss
@ -22,8 +34,7 @@
* aligator
* Code-Sploit
* NO11
* cora
* jordan4ibanez
* kabou
## Contributors
* Laurent Rocher
@ -75,6 +86,16 @@
* epCode
* NO11
* j45
* 3raven
* PrarieWind
* Gustavo1
* CableGuy67
## Mineclonia
* erlehmann
* Li0n
* E
* n_to
## Original Mod Authors
* Wuzzy

212
GROUPS.md
View File

@ -1,212 +0,0 @@
## Groups
This document explains all the groups used in this game.
### Special groups
* `not_in_creative_inventory=1`: Item will not be shown in creative inventory
* `not_in_craft_guide=1`: Item will not be shown as result or fuel item in crafting guide (but still may be shown as ingredient)
### Digging time groups
The basic digging time groups determine by which tools a node can be dug.
* `pickaxey`: Diggable by pickaxe. The rating is for the possible tool materials in which the node will make its useful drop:
* `pickaxey=1`: Wood, gold, stone, iron and diamond
* `pickaxey=2`: Gold, stone, iron and diamond
* `pickaxey=3`: Stone, iron and diamond
* `pickaxey=4`: Iron and diamond
* `pickaxey=5`: Diamond
* `axey`: Axe. Rating is same as for `pickaxey`
* `shovely`: Shovel. Rating is same as for `pickaxey`
* `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
* `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
Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times work in Minecraft, as MineClone 2 is based on the same system.
### Groups for interactions
* `crush_after_fall=1`: For falling nodes. These will crush whatever they hit after falling, not dropping as an item
* `falling_node_damage=1`: For falling nodes. Hurts any objects it hits while falling. Damage is based on anvils
* `dig_by_water=1`: Blocks with this group will drop when they are near flowing water
* `destroy_by_lava_flow=1`: Blocks with this group will be destroyed by flowing lava
* `dig_by_piston=1`: Blocks which will drop as an item when pushed by a piston. They also cannot be pulled by sticky pistons
* `cultivatable=2`: Block will be turned into Farmland by using a hoe on it
* `cultivatable=1`: Block will be turned into Dirt by using a hoe on it
* `flammable`: Block spreads fire
* `flammable>0`: Gets destroyed by fire
* `flammable=-1` Does not get destroyed by fire
* `fire_encouragement`: How quickly this block catches fire
* `fire_flammability`: How fast the block will burn away
* `spreading_dirt_type=1`: A dirt-type block with a cover (e.g. grass) which may spread to neighbor dirt blocks
* `dirtifies_below_solid=1`: This node turns into dirt immediately when a solid or dirtifier node is placed on top
* `dirtifier=1`: This node turns nodes the above group into dirt when placed above
* `non_mycelium_plant=1`: A plant which can't grow on mycelium. Placing it on mycelium fails and if mycelium spreads below it, it uproots
* `soil=1`: Saplings and other small plants can grow on it
* `soil_sapling=2`: Soil for saplings. Intended to be natural soil. All saplings will grow on this
* `soil_sapling=1`: Artificial soil (such as farmland) for saplings. Some saplings will not grow on this
* `soil_sugarcane=1`: Sugar canes will grow on this near water
* `soil_nether_wart=1`: Nether wart will grow on this
* `enderman_takable=1`: Block can be taken and placed by endermen
* `disable_suffocation=1`: Disables suffocation for full solid cubes (1)
* `destroys_items=1`: If an item happens to be *inside* this node, the item will be destroyed
* `no_eat_delay=1`: Only for foodstuffs. When eating this, all eating delays are ignored.
* `can_eat_when_full=1`: Only for foodstuffs. This item can be eaten when the user has a full hunger bar
* `attached_node_facedir=1`: Like `attached_node`, but for facedir nodes
* `cauldron`: Cauldron. 1: Empty. 2-4: Water height
* `anvil`: Anvil. 1: No damage. 2-3: Higher damage levels
* `no_rename=1`: Item cannot be renamed by anvil
* `comparator_signal=X`: If set, this node outputs a constant (!) comparator signal output of strength X.
* `piston=X`: Piston (main body) (1 = normal, 2 = sticky)
* `piston_pusher=X`: Piston pusher (1 = normal, 2 = sticky)
* `hopper=X`: Hopper (1 = downwards, 2 = sideways)
* `portal=1`: Portal (node that teleports players and things by standing inside)
* `end_portal_frame=X`: End portal frame (1 = no eye, 2 = with eye)
* `coral=X`: Coral (any type) (1 = alive, 2 = dead)
* `coral_plant=X`: Coral in the "plant" shape (1 = alive, 2 = dead)
* `coral_fan=X`: Coral fan (1 = alive, 2 = dead)
* `coral_block=X`: Coral block (1 = alive, 2 = dead)
* `coral_species=X`: Specifies the species of a coral; equal X means equal species
* `set_on_fire=X`: Sets any (not fire-resistant) mob or player on fire for X seconds when touching
#### Footnotes
1. Normally, all walkable blocks with the default 1×1×1 cube as a collision box (e.g. sand,
gravel, stone, but not fences) will damage the players while their head is inside. This
is called “suffocation”. Setting this group disables this behaviour
### Groups (mostly) used for crafting recipes
* `sand=1`: Sand (any color)
* `sandstone=1`: Sandstone (any color) and related nodes (chiseled and the like) (only full blocks)
* `normal_sandstone=1`: “Normal” (yellow) sandstone and related nodes (chiseled and the like) (only full blocks)
* `red_sandstone=1`: Red sandstone and related nodes (chiseled and the like) (only full blocks)
* `hardened_clay=1`: Terracotta (any color)
* `quartz_block=1`: Quartz Block and variants (chiseled, pillar, etc.) (only full blocks)
* `stonebrick=1`: Stone Bricks and related nodes (only full blocks)
* `shulker_box=1`: Block is a shulker box
* `tree=1`: Oak Wood, Birch Wood, etc. (tree trunks)
* `wood=1`: Oak Wood Planks, Birch Wood Planks, etc. (only full blocks)
* `wood_slab=1`: Slabs made out of a kind of wooden planks
* `wood_stairs=1`: Stairs made out of a kind of wooden planks
* `coal=1`: Coal of any kind (lumps only, not blocks)
* `wool=1`: Wool (only full blocks)
* `carpet=1:` (Wool) carpet
* `stick=1`: Stick
* `water_bucket=1`: Bucket containing a liquid of group “water”
* `enchantability=X`: How good the enchantments are the item gets (1 equals book)
* `enchanted=1`: The item is already enchanted, meaning that it can't be enchanted using an enchanting table
### Material groups
These groups correspond to the Minecraft materials. They classify the block into a type, indicating what the block is “made off”.
* `material_stone=1`: Stone
* `material_wood=1`: Wood
* `material_sand=1`: Sand
* `material_glass=1`: Glass
Currently, these groups are used for the note block.
Note that not all Minecraft materials are used so far. More Minecraft materials will lilely only be added when they are needed for a concrete use case.
### Declarative groups
These groups are used mostly for informational purposes
* `solid=1`: Solid full-cube block (automatically assigned)
* `opaque=1`: Opaque block (automatically assigned)
* `not_solid=1`: Block is not solid (only assign this group for nodes which are automatically detected as “solid” in error
* `not_opaque=1`: Block is not opaque (only assign this group for nodes which are automatically detected as “opaque” in error
* `fire=1`: Fire
* `water=1`: Water
* `lava=1`: Lava
* `top_snow=X`: Top snow with X layers (1-8)
* `torch`: Torch or torch-like node
* `torch=1`: Torch on floor
* `torch=2`: Torch at wall
* `liquid`: Block is a liquid
* `liquid=1`: Unspecified type
* `liquid=2`: Water
* `liquid=3`: Lava
* `fence=1`: Fence
* `fence_gate=1`: Fence gate
* `fence_wood=1`: Wooden fence
* `fence_nether_brick=1`: Nether brick fence
* `flower_pot`: Flower pot
* `flower_pot=1`: Empty flower pot
* `flower_pot=2`: Flower pot with a plant or flower
* `flower=1`: Flower
* `place_flowerlike=1`: Node has placement rules like that of a flower
* `place_flowerlike=2`: Node has placement rules like tall grass
* `cake`: Cake (rating = slices left)
* `book=1`: Book
* `pane=1`: Node is a “pane”-like node glass pane or iron bars
* `bed=1`: Bed
* `door=1`: Door
* `trapdoor=1`: Closed trapdoor
* `trapdoor=2`: Open trapdoor
* `glass=1`: Glass (full cubes only)
* `rail=1`: Rail
* `music_record`: Item is Music Disc
* `tnt=1`: Block is TNT
* `boat=1`: Boat
* `minecart=1`: Minecart
* `food`: Item is a comestible item which can be consumed (healthy or unhealthy)
* `food=2`: Food
* `food=3`: Drink (including soups)
* `food=1`: Other/unsure
* `eatable`: Item can be *directly* eaten by wielding + right click (`on_use=item_eat`). Rating is the satiation gain
* `cocoa`: Node is a cocoa pod (rating is growth stage, ranging from 1 to 3)
* `ammo=1`: Item is used as ammo for a weapon
* `ammo_bow=1`: Item is used as ammo for bows
* `non_combat_armor=1`: Item can be equipped as armor, but is not made for combat (e.g. zombie head, pumpkin)
* `container`: Node is a container which physically stores items within and has at least 1 inventory
* `container=2`: Has one inventory with list name `"main"`. Items can be placed and taken freely
* `container=3`: Same as `container=2`, but shulker boxes can not be inserted
* `container=4`: Furnace-like, has lists `"src"`, `"fuel"` and `"dst"`.
It is expected that this also reacts on `on_timer`;
the node timer must be started from other mods when they add into `"src"` or `"fuel"`
* `container=5`: Left part of a 2-part horizontal connected container. Both parts have a `"main"` inventory
list. Both inventories are considered to belong together. This is used for large chests.
* `container=6`: Same as above, but for the right part.
* `container=7`: Has inventory list "`main`", no movement allowed
* `container=1`: Other/unspecified container type
* `spawn_egg=1`: Spawn egg
* `pressure_plate=1`: Pressure plate (off)
* `pressure_plate=2`: Wooden pressure (on)
* `button=1`: Button (off)
* `button=2`: Button (on)
* `redstone_torch=1`: Redstone Torch (lit)
* `redstone_torch=2`: Redstone Torch (unlit)
* `plant=1`: Plant or part of a plant
* `double_plant`: Part of a double-sized plant. 1 = lower part, 2 = upper part
* `pickaxe=1`: Pickaxe
* `shovel=1`: Shovel
* `axe=1`: Axe
* `sword=1`: Sword
* `hoe=1`: Hoe (farming tool)
* `shears=1`: Shears
* `weapon=1`: Item is primarily (!) a weapon
* `tool=1`: Item is primarily (!) a tool
* `craftitem=1`: Item is primarily (!) used for crafting
* `brewitem=1`: Item is primarily (!) used in brewing
* `transport=1`: Item is used for transportation
* `building_block=1`: Block is a building block
* `deco_block=1`: Block is a decorational block
## Fake item groups
These groups put similar items together which should all be treated by the gameplay or the GUI as a single item.
You should not add custom items to these groups for no good reason, this is likely to cause a ton of conflicts.
* `clock`: Clock (rating indicates the “frame”)
* `compass`: Compass (rating indicates the “frame”)
This has the following implication: If you want to use a compass or clock in a crafting recipe, you *must*
use `group:compass` or `group:clock`, respectively.

View File

@ -5,10 +5,11 @@ 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.
MineCloneJEpC (by kay27, EliasFleckenstein, Wuzzy, ROllerozxa,
Lazerbeak12345, davedevils and countless others) is an imitation
of Minecraft.
MineClone 2 is free software: you can redistribute it and/or modify
MineCloneJEpC 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.
@ -25,12 +26,15 @@ You can choose which license applies to you: Either the
license of MineClone 2 (GNU GPLv3) or the mod's license.
MineClone 2 is a direct continuation of the discontinued MineClone
project by davedevils.
project by davedevils. MineCloneJEpC is a fork of MineClone 2, which
was merged by Lazerbeak12345 with Minecraftn't Pre-classic by
ROllerozxa, a fork of Minecraftn't Classic by ROllerozxa, which is a
fork of MineClone 2.
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 MineCloneJEpC and the author is documented in the git history.
## License of media (textures and sounds)
No non-free licenses are used anywhere.
@ -50,3 +54,9 @@ http://creativecommons.org/licenses/by-sa/3.0/
See README.txt in each mod directory for detailed information about other authors.
Due to potential copyright problems with Minecraftn't Classic and
Pre-classic at one point containing assets copyrighted by Mojang
(which none of these projects are associated with), when manually
cherry-picking the code from Minecraftn't Pre-classic to be forked on
top of MCL2, I made sure to exclude anything that might be copyrighted
by Mojang.

225
README.md
View File

@ -1,195 +1,120 @@
# MineClone2
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
# MineCloneJEpC
An unofficial Minecraft-like game for Minetest. Forked from MineClone 2 by Wuzzy
and merged with Minecraftn't Pre-classic by ROllerozxa
Developed by many people. Not developed or endorsed by Mojang AB.
Version: 0.72.0 (in development)
Version: 0.1 (in development)
### Gameplay
You start in a randomly-generated world made entirely of cubes. You can explore
the world and dig and build almost every block in the world to create new
structures. You can choose to play in a “survival mode” in which you have to
fight monsters and hunger for survival and slowly progress through the
various other aspects of the game, such as mining, farming, building machines, and so on
Or you can play in “creative mode” in which you can build almost anything instantly.
SPECIFIC VERSION OF MINECRAFT CLONED: `old_alpha rd-132211`
#### Gameplay summary
## Purpose and method
### Purpose
The primary purpose of this game is to improove MineClone 2 by researching the
development of Minecraft through implimenting each important release in-order.
As a side-effect, this will mean each release is a playable game on it's own -
but if this project ever catches up to MineClone 2, it will _not_ duplicate
code, and will avoid cloning the exact version that project is cloning.
### Method
- Make a game that clones the oldest Minecraft release.
- Make a modpack for each release following, that expands that game to become a
clone of the modpack's release.
- Where only absolutely necessary, fork the game to make a release. All future
modpacks are to be based on the new game. Such an example would be where making
a change to the `game.conf` file is the only option.
## Gameplay
You start in a flat world made entirely of cubes. You can explore the world and
dig almost every block in the world, and can use cobblestone to create new
structures.
Keeping true to the exact version of Minecraft that this is cloning, it's pretty
bare. There are only grass and cobblestone blocks. (TODO) Press the action key
to respawn.
### Gameplay summary
* Sandbox-style gameplay, no goals
* Survive: Fight against hostile monsters and hunger
* Mine for ores and other treasures
* Magic: Gain experience and enchant your tools
* Use the collected blocks to create great buildings, your imagination is the limit
* Collect flowers (and other dye sources) and colorize your world
* Find some seeds and start farming
* Find or craft one of hundreds of items
* Build a railway system and have fun with minecarts
* Build complex machines with redstone circuits
* In creative mode you can build almost anything for free and without limits
* Use blocks to create great buildings, your imagination is the limit
* You can build almost anything for free (no cost) and without limit
## How to play (quick start)
### Getting started
* **Punch a tree** trunk until it breaks and collect wood
* Place the **wood into the 2×2 grid** (your “crafting grid” in your inventory menu and craft 4 wood planks
* Place the 4 wood planks in a 2×2 shape in the crafting grid to **make a crafting table**
* **Rightclick the crafting table** for a 3×3 crafting grid to craft more complex things
* Use the **crafting guide** (book icon) to learn all the possible crafting recipes
* **Craft a wooden pickaxe** so you can dig stone
* Different tools break different kinds of blocks. Try them out!
* Continue playing as you wish. Have fun!
### Farming
* Find seeds
* Craft hoe
* Rightclick dirt or similar block with hoe to create farmland
* Place seeds on farmland and watch them grow
* Collect plant when fully grown
* If near water, farmland becomes wet and speeds up growth
### Furnace
* Craft furnace
* Furnace allows you to obtain more items
* Upper slot must contain a smeltable item (example: iron ore)
* Lower slot must contain a fuel item (example: coal)
* See tooltips in crafting guide to learn about fuels and smeltable items
### Additional help
More help about the gameplay, blocks items and much more can be found from inside
the game. You can access the help from your inventory menu.
### Special items
The following items are interesting for Creative Mode and for adventure
map builders. They can not be obtained in-game or in the creative inventory.
* Barrier: `mcl_core:barrier`
Use the `/giveme` chat command to obtain them. See the in-game help for
an explanation.
- Mine with right click
- Place with left click
- Walk around
## Installation
This game requires [Minetest](http://minetest.net) to run (version 5.3.0 or
later). So you need to install Minetest first. Only stable versions of Minetest
are officially supported.
There is no support for running MineClone2 in development versions of Minetest.
This game requires [Minetest](http://minetest.net) to run (version 5.4.1 or
later). Older versions might work, but this is untested. So you need to install
Minetest first. Only stable versions of Minetest are officially supported.
There is no support for running MineCloneJEpC on development versions of
Minetest.
To install MineClone2 (if you haven't already), move this directory into the
“games” directory of your Minetest data directory. Consult the help of
To install MineCloneJEpC (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.
## Useful links
The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there.
The MineCloneJEpC repository is hosted at Mesehub. To contribute or report issues, head there.
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
* Discord: <https://discord.gg/xE4z8EEpDC>
* YouTube <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
* IRC: <https://web.libera.chat/#mineclone2>
* Matrix: <https://app.element.io/#/room/#mc2:matrix.org>
* Reddit: <https://www.reddit.com/r/MineClone2/>
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
* ContentDB: <https://content.minetest.net/packages/wuzzy/mineclone2/>
* OpenCollective: <https://opencollective.com/mineclone2>
* Mesehub: <https://git.minetest.land/Lazerbeak12345/MineCloneJEpC>
Here's the Minecraft wiki page on the version of Minecraft that this is cloning.
<https://minecraft.fandom.com/wiki/Java_Edition_pre-Classic_rd-132211>
## Target
- Crucially, create a stable, moddable, free/libre clone of Minecraft
based on the Minetest engine with polished features, usable in both
singleplayer and multiplayer. Currently, most of **Minecraft Java
Edition 1.12.2** features are already implemented and polishing existing
features are prioritized over new feature requests.
- With lessened priority yet strictly, implement features targetting
**Minecraft version 1.17 + OptiFine** (OptiFine only as far as supported
by the Minetest Engine). This means features in parity with the listed
Minecraft experiences are prioritized over those that don't fulfill this
scope.
`old_alpha rd-132211` based on the Minetest engine with polished features.
No other features will be added - though modifications to apis will be, if
they facilitate making mods or modpacks to expand this game to clone a newer
version of Minecraft.
- Optionally, create a performant experience that will run relatively
well on really low spec computers. Unfortunately, due to Minecraft's
mechanisms and Minetest engine's limitations along with a very small
playerbase on low spec computers, optimizations are hard to investigate.
## Completion status
This game is currently in **beta** stage.
It is playable, but not yet feature-complete.
This game is currently in **pre-alpha** stage.
It is playable, but has a few tweaks left.
Backwards-compability is not entirely guaranteed, updating your world might cause small bugs.
If you want to use the git version of MineClone2 in production, consider using the production branch.
It is updated weekly and contains relatively stable code for servers.
The following main features are available:
These things need figured out, and I don't know how to do them:
* Tools, weapons
* Armor
* Crafting system: 2×2 grid, crafting table (3×3 grid), furnace, including a crafting guide
* Chests, large chests, ender chests, shulker boxes
* Furnaces, hoppers
* Hunger
* Most monsters and animals
* All ores from Minecraft
* Most blocks in the overworld
* Water and lava
* Weather
* 28 biomes
* The Nether, a fiery underworld in another dimension
* Redstone circuits (partially)
* Minecarts (partial)
* Status effects (partial)
* Experience
* Enchanting
* Brewing, potions, tipped arrow (partial)
* Boats
* Fire
* Buidling blocks: Stairs, slabs, doors, trapdoors, fences, fence gates, walls
* Clock
* Compass
* Sponge
* Slime block
* Small plants and saplings
* Dyes
* Banners
* Deco blocks: Glass, stained glass, glass panes, iron bars, hardened clay (and colors), heads and more
* Item frames
* Jukeboxes
* Beds
* Inventory menu
* Creative inventory
* Farming
* Writable books
* Commands
* Villages
* The End
* And more!
* In this edition of minecraft, a left-click places, and a right-click mines.
(opposite of later versions, and of Minetest defaults)
* A way for modpacks to change values in `game.conf` (This will only effect how mods expanding this game function)
* mapgen
* gamemodes
* etc.
The following features are incomplete:
The following main features are available (including features I must now remove):
* Some monsters and animals
* Redstone-related things
* Special minecarts
* A couple of non-trivial blocks and items
Bonus features (not found in Minecraft 1.12):
* Built-in crafting guide which shows you crafting and smelting recipes
* In-game help system containing extensive help about gameplay basics, blocks, items and more
* Temporary crafting recipes. They only exist to make some otherwise unaccessible items available when you're not in creative mode. These recipes will be removed as development goes on an more features become available
* Saplings in chests in mapgen v6
* Blocks in the overworld
* Buidling blocks: Stone, Dirt
* Commands (TO BE REMOVED)
* Fully moddable (thanks to Minetest's powerful Lua API)
* New blocks and items:
* Lookup tool, shows you the help for whatever it touches
* More slabs and stairs
* Nether Brick Fence Gate
* Red Nether Brick Fence
* Red Nether Brick Fence Gate
* And more! (It's a lot of work to remove - but not so much anymore thanks to ROllerozxa)
Technical differences from Minecraft:
* Height limit of ca. 31000 blocks (much higher than in Minecraft)
* Horizontal world size is ca. 62000×62000 blocks (much smaller than in Minecraft, but it is still very large)
* Still very incomplete and buggy
* Blocks, items, enemies and other features are missing
* Blocks, items and other features that shouldn't be there
* A few items have slightly different names to make them easier to distinguish
* Different music for jukebox
* Different textures (Pixel Perfection)
* Different sounds (various sources)
* Different sounds (various sources) (TO BE REMOVED)
* Different engine (Minetest)
* Different easter eggs
… and finally, MineClone2 is free software (“free” as in “freedom”)!
… and finally, MineCloneJEpC is free software (“free” as in “freedom”)!
## Other readme files

View File

@ -1 +1 @@
A survival sandbox game. Survive, gather, hunt, mine, build, explore, and do much more. Faithful clone of Minecraft 1.12. This is a work in progress! Expect bugs!
A clone of a historic sandbox game, Mincraft rd-132211. Mine, build and explore. This is a work in progress! Expect bugs!

View File

@ -1,2 +1,5 @@
name = MineClone 2
description = A survival sandbox game. Survive, gather, hunt, build, explore, and do much more.
name = MineCloneJEpC
description = A clone of a historic sandbox game. Build, explore, and do little more.
disabled_settings = enable_damage,creative_mode,enable_server
allowed_mapgens = singlenode
disallowed_mapgen_settings = seed

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 KiB

After

Width:  |  Height:  |  Size: 51 KiB

BIN
menu/icon_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 KiB

After

Width:  |  Height:  |  Size: 830 KiB

View File

@ -4,44 +4,7 @@
# They will override these settings
# Basic game rules
time_speed = 72
# Player physics
movement_acceleration_default = 2.4
movement_acceleration_air = 1.2
#movement_acceleration_fast = 10
movement_speed_walk = 4.317
movement_speed_crouch = 1.295
movement_speed_fast = 25.0
movement_speed_jump = 6.6
movement_speed_climb = 2.35
# TODO: Add descend speed (3.0) when available
movement_liquid_fluidity = 1.13
movement_liquid_fluidity_smooth = 0.5
movement_liquid_sink = 23
movement_gravity = 10.4
# Mapgen stuff
# altitude_chill and altitude_dry doesn't go well together with MCL2 biomes
# which already include "snowed" variants as you go higher.
# humid_rivers would cause the MushroomIsland biome to appear frequently around rivers.
mgvalleys_spflags = noaltitude_chill,noaltitude_dry,nohumid_rivers,vary_river_depth
# MCL2-specific stuff
keepInventory = false
# Performance settings
dedicated_server_step = 0.05 #tick rate
# abm_interval = 0.25
# max_objects_per_block = 4096
# max_packets_per_iteration = 10096
# Clientmodding to support official client
enable_client_modding = true
csm_restriction_flags = 0
enable_mod_channels = true
item_entity_ttl = 1
# This wasn't working, so I've also specified this in `mcljepc_core`
time_speed = 0
node_highlighting = halo

View File

@ -1,15 +0,0 @@
This mod automatically adds groups to items based on item metadata.
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.
As of 0.4.16, Minetest loads mods in reverse alphabetical order.

View File

@ -1,367 +0,0 @@
--[[
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:
1) The block's hardness
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.
How the mod is used
===================
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).
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.
_mcl_diggroups = {
handy = { speed = 1, level = 1, uses = 0 },
pickaxey = { speed = 1, level = 0, uses = 0 },
}
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.
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] 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
-- 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 function overwrite()
for nname, ndef in pairs(minetest.registered_nodes) do
local newgroups = table.copy(ndef.groups)
if (nname ~= "ignore" and ndef.diggable) then
-- 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
end
-- 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
end
--local creative_breakable = false
-- 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
for i = ndef.groups[g], #gdef.levels do
newgroups[g .. "_dig_" .. gdef.levels[i]] = index
end
else
newgroups[g .. "_dig"] = index
end
end
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
overwrite()

View File

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

View File

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

View File

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

View File

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

View File

@ -1,23 +0,0 @@
# controls
## controls.players
Table containing player controls at runtime.
WARNING: Never use this table in writing
## controls.register_on_press(func)
Register a function that will be executed with (player, keyname) every time a player press a key.
## controls.registered_on_press
Table containing functions registered with controls.register_on_press().
## controls.register_on_release(func)
Register a function that will be executed with (player, keyname, clock_from_last_press) every time a player release a key.
## controls.registered_on_release
Table containing functions registered with controls.register_on_release().
## controls.register_on_hold(func)
Register a function that will be executed with (player, keyname, clock_from_start_hold) every time a player hold a key.
## controls.registered_on_hold
Table containing functions registered with controls.register_on_hold().

View File

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,2 +0,0 @@
Controls framework by Arcelmi.
https://github.com/Arcelmi/minetest-controls

View File

@ -1,77 +0,0 @@
local get_connected_players = minetest.get_connected_players
local clock = os.clock
local pairs = pairs
controls = {}
controls.players = {}
controls.registered_on_press = {}
function controls.register_on_press(func)
controls.registered_on_press[#controls.registered_on_press+1] = func
end
controls.registered_on_release = {}
function controls.register_on_release(func)
controls.registered_on_release[#controls.registered_on_release+1] = func
end
controls.registered_on_hold = {}
function controls.register_on_hold(func)
controls.registered_on_hold[#controls.registered_on_hold+1]=func
end
local known_controls = {
jump = true,
right = true,
left = true,
LMB = true,
RMB = true,
sneak = true,
aux1 = true,
down = true,
up = true,
}
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
controls.players[name] = {}
for cname,_ in pairs(known_controls) do
controls.players[name][cname] = { false }
end
end)
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
controls.players[name] = nil
end)
minetest.register_globalstep(function(dtime)
for _, player in pairs(get_connected_players()) do
local player_name = player:get_player_name()
local player_controls = player:get_player_control()
if controls.players[player_name] then
for cname, cbool in pairs(player_controls) do
if known_controls[cname] == true then
--Press a key
if cbool == true and controls.players[player_name][cname][1] == false then
for _, func in pairs(controls.registered_on_press) do
func(player, cname)
end
controls.players[player_name][cname] = {true, clock()}
elseif cbool == true and controls.players[player_name][cname][1] == true then
for _, func in pairs(controls.registered_on_hold) do
func(player, cname, clock()-controls.players[player_name][cname][2])
end
--Release a key
elseif cbool == false and controls.players[player_name][cname][1] == true then
for _, func in pairs(controls.registered_on_release) do
func(player, cname, clock()-controls.players[player_name][cname][2])
end
controls.players[player_name][cname] = {false}
end
end
end
end
end
end)

View File

@ -1,4 +0,0 @@
name = controls
author = Arcelmi
description = Controls framework by Arcelmi

View File

@ -1,45 +0,0 @@
# flowlib
Simple flow functions.
## flowlib.is_touching(realpos, nodepos, radius)
Return true if a sphere of <radius> at <realpos> collide with node at <nodepos>.
* realpos: position
* nodepos: position
* radius: number
## flowlib.is_water(pos)
Return true if node at <pos> is water, false overwise.
* pos: position
## flowlib.node_is_water(node)
Return true if <node> is water, false overwise.
* node: node
## flowlib.is_lava(pos)
Return true if node at <pos> is lava, false overwise.
* pos: position
## flowlib.node_is_lava(node)
Return true if <node> is lava, false overwise.
* node: node
## flowlib.is_liquid(pos)
Return true if node at <pos> is liquid, false overwise.
* pos: position
## flowlib.node_is_liquid(node)
Return true if <node> is liquid, false overwise.
* node: node
## flowlib.quick_flow(pos, node)
Return direction where the water is flowing (to be use to push mobs, items...).
* pos: position
* node: node
## flowlib.move_centre(pos, realpos, node, radius)
Return the pos of the nearest not water block near from <pos> in a sphere of <radius> at <realpos>.
WARNING: This function is never used in mcl2, use at your own risk. The informations described here may be wrong.
* pos: position
* realpos: position, position of the entity
* node: node
* radius: number

View File

@ -1,7 +0,0 @@
Flowlib
================
Simple flow functions for use in Minetest mods by Qwertymine3
License of source code:
-----------------------
WTFPL

View File

@ -1,153 +0,0 @@
local math = math
local get_node = minetest.get_node
local get_item_group = minetest.get_item_group
local registered_nodes = minetest.registered_nodes
flowlib = {}
--sum of direction vectors must match an array index
--(sum,root)
--(0,1), (1,1+0=1), (2,1+1=2), (3,1+2^2=5), (4,2^2+2^2=8)
local inv_roots = {
[0] = 1,
[1] = 1,
[2] = 0.70710678118655,
[4] = 0.5,
[5] = 0.44721359549996,
[8] = 0.35355339059327,
}
local function to_unit_vector(dir_vector)
local sum = dir_vector.x * dir_vector.x + dir_vector.z * dir_vector.z
return {x = dir_vector.x * inv_roots[sum], y = dir_vector.y, z = dir_vector.z * inv_roots[sum]}
end
local function is_touching(realpos,nodepos,radius)
local boarder = 0.5 - radius
return math.abs(realpos - nodepos) > (boarder)
end
flowlib.is_touching = is_touching
local function is_water(pos)
return get_item_group(get_node(pos).name, "water") ~= 0
end
flowlib.is_water = is_water
local function node_is_water(node)
return get_item_group(node.name, "water") ~= 0
end
flowlib.node_is_water = node_is_water
local function is_lava(pos)
return get_item_group(get_node(pos).name, "lava") ~= 0
end
flowlib.is_lava = is_lava
local function node_is_lava(node)
return get_item_group(node.name, "lava") ~= 0
end
flowlib.node_is_lava = node_is_lava
local function is_liquid(pos)
return get_item_group(get_node(pos).name, "liquid") ~= 0
end
flowlib.is_liquid = is_liquid
local function node_is_liquid(node)
return minetest.get_item_group(node.name, "liquid") ~= 0
end
flowlib.node_is_liquid = node_is_liquid
--This code is more efficient
local function quick_flow_logic(node, pos_testing, direction)
local name = node.name
if not registered_nodes[name] then
return 0
end
if registered_nodes[name].liquidtype == "source" then
local node_testing = get_node(pos_testing)
if not registered_nodes[node_testing.name] then
return 0
end
if registered_nodes[node_testing.name].liquidtype ~= "flowing" then
return 0
else
return direction
end
elseif registered_nodes[name].liquidtype == "flowing" then
local node_testing = get_node(pos_testing)
local param2_testing = node_testing.param2
if not registered_nodes[node_testing.name] then
return 0
end
if registered_nodes[node_testing.name].liquidtype == "source" then
return -direction
elseif registered_nodes[node_testing.name].liquidtype == "flowing" then
if param2_testing < node.param2 then
if (node.param2 - param2_testing) > 6 then
return -direction
else
return direction
end
elseif param2_testing > node.param2 then
if (param2_testing - node.param2) > 6 then
return direction
else
return -direction
end
end
end
end
return 0
end
local function quick_flow(pos, node)
if not node_is_liquid(node) then
return {x = 0, y = 0, z = 0}
end
local x = quick_flow_logic(node,{x = pos.x-1, y = pos.y, z = pos.z},-1) + quick_flow_logic(node,{x = pos.x+1, y = pos.y, z = pos.z}, 1)
local z = quick_flow_logic(node,{x = pos.x, y = pos.y, z = pos.z-1},-1) + quick_flow_logic(node,{x = pos.x, y = pos.y, z = pos.z+1}, 1)
return to_unit_vector({x = x, y = 0, z = z})
end
flowlib.quick_flow = quick_flow
--if not in water but touching, move centre to touching block
--x has higher precedence than z
--if pos changes with x, it affects z
local function move_centre(pos, realpos, node, radius)
if is_touching(realpos.x, pos.x, radius) then
if is_liquid({x = pos.x-1, y = pos.y, z = pos.z}) then
node = get_node({x=pos.x-1, y = pos.y, z = pos.z})
pos = {x = pos.x-1, y = pos.y, z = pos.z}
elseif is_liquid({x = pos.x+1, y = pos.y, z = pos.z}) then
node = get_node({x = pos.x+1, y = pos.y, z = pos.z})
pos = {x = pos.x+1, y = pos.y, z = pos.z}
end
end
if is_touching(realpos.z, pos.z, radius) then
if is_liquid({x = pos.x, y = pos.y, z = pos.z - 1}) then
node = get_node({x = pos.x, y = pos.y, z = pos.z - 1})
pos = {x = pos.x, y = pos.y, z = pos.z - 1}
elseif is_liquid({x = pos.x, y = pos.y, z = pos.z + 1}) then
node = get_node({x = pos.x, y = pos.y, z = pos.z + 1})
pos = {x = pos.x, y = pos.y, z = pos.z + 1}
end
end
return pos, node
end
flowlib.move_centre = move_centre

View File

@ -1,4 +0,0 @@
name = flowlib
author = Qwertymine3
description = Simple flow functions for use in Minetest mods by Qwertymine3

View File

@ -1,29 +0,0 @@
local vector = vector
local facedir_to_dir = minetest.facedir_to_dir
local get_item_group = minetest.get_item_group
local remove_node = minetest.remove_node
local get_node = minetest.get_node
local original_function = minetest.check_single_for_falling
function minetest.check_single_for_falling(pos)
local ret_o = original_function(pos)
local ret = false
local node = minetest.get_node(pos)
if get_item_group(node.name, "attached_node_facedir") ~= 0 then
local dir = facedir_to_dir(node.param2)
if dir then
if get_item_group(get_node(vector.add(pos, dir)).name, "solid") == 0 then
remove_node(pos)
local drops = minetest.get_node_drops(node.name, "")
for dr=1, #drops do
minetest.add_item(pos, drops[dr])
end
ret = true
end
end
end
return ret_o or ret
end

View File

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

View File

@ -1,27 +0,0 @@
# mcl_autogroup
This mod emulate digging times from mc.
## mcl_autogroup.can_harvest(nodename, toolname)
Return true if <nodename> can be dig with <toolname>.
* nodename: string, valid nodename
* toolname: (optional) string, valid toolname
## mcl_autogroup.get_groupcaps(toolname, efficiency)
This function is used to calculate diggroups for tools.
WARNING: This function can only be called after mod initialization.
* toolname: string, name of the tool being enchanted (like "mcl_tools:diamond_pickaxe")
* efficiency: (optional) integer, the efficiency level the tool is enchanted with (default 0)
## mcl_autogroup.get_wear(toolname, diggroup)
Return the max wear of <toolname> with <diggroup>
WARNING: This function can only be called after mod initialization.
* toolname: string, name of the tool used
* diggroup: string, the name of the diggroup the tool is used on
## mcl_autogroup.register_diggroup(group, def)
* group: string, name of the group to register as a digging group
* def: (optional) table, table with information about the diggroup (defaults to {} if unspecified)
* level: (optional) string, if specified it is an array containing the names of the different digging levels the digging group supports
## mcl_autogroup.registered_diggroups
List of registered diggroups, indexed by name.

View File

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

@ -1,3 +0,0 @@
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,8 +0,0 @@
# mcl_colors
Mod providing global table containing legacity 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

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

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

View File

@ -1,15 +0,0 @@
# mcl_damage
This mod is intended to overall minetest's native damage system, to provide a better integration between features that deals with entities' health.
WARNING: Not using it inside your mods may cause strange bugs (using the native damage system may cause conflicts with this system).
## Callbacks
To modify the amount of damage made by something:
```lua
--obj: an ObjectRef
mcl_damage.register_modifier(function(obj, damage, reason)
end, 0)
```

View File

@ -1,169 +0,0 @@
mcl_damage = {
modifiers = {},
damage_callbacks = {},
death_callbacks = {},
types = {
in_fire = {is_fire = true},
lightning_bolt = {is_lightning = true},
on_fire = {is_fire = true, bypasses_armor = true},
lava = {is_fire = true},
hot_floor = {is_fire = true},
in_wall = {bypasses_armor = true},
drown = {bypasses_armor = true},
starve = {bypasses_armor = true, bypasses_magic = true},
cactus = {},
fall = {bypasses_armor = true},
fly_into_wall = {bypasses_armor = true}, -- unused
out_of_world = {bypasses_armor = true, bypasses_magic = true, bypasses_invulnerability = true},
generic = {bypasses_armor = true},
magic = {is_magic = true, bypasses_armor = true},
dragon_breath = {is_magic = true, bypasses_armor = true}, -- this is only used for dragon fireball; dragon fireball does not actually deal impact damage tho, so this is unreachable
wither = {bypasses_armor = true}, -- unused
wither_skull = {is_magic = true, is_explosion = true}, -- this is non-MC but a workaround to get the proper death message
anvil = {},
falling_node = {}, -- this is falling_block in MC
mob = {},
player = {},
arrow = {is_projectile = true},
fireball = {is_projectile = true, is_fire = true},
thorns = {is_magic = true},
explosion = {is_explosion = true},
cramming = {bypasses_armor = true}, -- unused
fireworks = {is_explosion = true}, -- unused
}
}
function mcl_damage.register_modifier(func, priority)
table.insert(mcl_damage.modifiers, {func = func, priority = priority or 0})
end
function mcl_damage.register_on_damage(func)
table.insert(mcl_damage.damage_callbacks, func)
end
function mcl_damage.register_on_death(func)
table.insert(mcl_damage.death_callbacks, func)
end
function mcl_damage.run_modifiers(obj, damage, reason)
for _, modf in ipairs(mcl_damage.modifiers) do
damage = modf.func(obj, damage, reason) or damage
if damage == 0 then
return 0
end
end
return damage
end
local function run_callbacks(funcs, ...)
for _, func in pairs(funcs) do
func(...)
end
end
function mcl_damage.run_damage_callbacks(obj, damage, reason)
run_callbacks(mcl_damage.damage_callbacks, obj, damage, reason)
end
function mcl_damage.run_death_callbacks(obj, reason)
run_callbacks(mcl_damage.death_callbacks, obj, reason)
end
function mcl_damage.from_punch(mcl_reason, object)
mcl_reason.direct = object
local luaentity = mcl_reason.direct:get_luaentity()
if luaentity then
if luaentity._is_arrow then
mcl_reason.type = "arrow"
elseif luaentity._is_fireball then
mcl_reason.type = "fireball"
elseif luaentity._cmi_is_mob then
mcl_reason.type = "mob"
end
mcl_reason.source = mcl_reason.source or luaentity._source_object
else
mcl_reason.type = "player"
end
end
function mcl_damage.finish_reason(mcl_reason)
mcl_reason.source = mcl_reason.source or mcl_reason.direct
mcl_reason.flags = mcl_damage.types[mcl_reason.type]
end
function mcl_damage.from_mt(mt_reason)
if mt_reason._mcl_chached_reason then
return mt_reason._mcl_chached_reason
end
local mcl_reason
if mt_reason._mcl_reason then
mcl_reason = mt_reason._mcl_reason
else
mcl_reason = {type = "generic"}
if mt_reason._mcl_type then
mcl_reason.type = mt_reason._mcl_type
elseif mt_reason.type == "fall" then
mcl_reason.type = "fall"
elseif mt_reason.type == "drown" then
mcl_reason.type = "drown"
elseif mt_reason.type == "punch" then
mcl_damage.from_punch(mcl_reason, mt_reason.object)
elseif mt_reason.type == "node_damage" and mt_reason.node then
if minetest.get_item_group(mt_reason.node, "fire") > 0 then
mcl_reason.type = "in_fire"
end
if minetest.get_item_group(mt_reason.node, "lava") > 0 then
mcl_reason.type = "lava"
end
end
for key, value in pairs(mt_reason) do
if key:find("_mcl_") == 1 then
mcl_reason[key:sub(6, #key)] = value
end
end
end
mcl_damage.finish_reason(mcl_reason)
mt_reason._mcl_cached_reason = mcl_reason
return mcl_reason
end
function mcl_damage.register_type(name, def)
mcl_damage.types[name] = def
end
minetest.register_on_player_hpchange(function(player, hp_change, mt_reason)
if hp_change < 0 then
if player:get_hp() <= 0 then
return 0
end
hp_change = -mcl_damage.run_modifiers(player, -hp_change, mcl_damage.from_mt(mt_reason))
end
return hp_change
end, true)
minetest.register_on_player_hpchange(function(player, hp_change, mt_reason)
if player:get_hp() > 0 then
mt_reason.approved = true
if hp_change < 0 then
mcl_damage.run_damage_callbacks(player, -hp_change, mcl_damage.from_mt(mt_reason))
end
end
end, false)
minetest.register_on_dieplayer(function(player, mt_reason)
if mt_reason.approved then
mcl_damage.run_death_callbacks(player, mcl_damage.from_mt(mt_reason))
end
end)
minetest.register_on_mods_loaded(function()
table.sort(mcl_damage.modifiers, function(a, b) return a.priority < b.priority end)
end)

View File

@ -1,3 +0,0 @@
name = mcl_damage
author = Fleckenstein
description = Minecraft-like damage reason system

View File

@ -1,15 +0,0 @@
# mcl_explosions
This mod provide helper functions to create explosions.
## mcl_explosions.explode(pos, strength, info, puncher)
* pos: position, initial position of the explosion
* strenght: number, radius of the explosion
* info: table, explosion informations:
* drop_chance: number, if specified becomes the drop chance of all nodes in the explosion (default: 1.0 / strength)
* max_blast_resistance: int, if specified the explosion will treat all non-indestructible nodes as having a blast resistance of no more than this value
* sound: bool, if true, the explosion will play a sound (default: true)
* particles: bool, if true, the explosion will create particles (default: true)
* fire: bool, if true, 1/3 nodes become fire (default: false)
* griefing: bool, if true, the explosion will destroy nodes (default: true)
* grief_protected: bool, if true, the explosion will also destroy nodes which have been protected (default: false)
* puncher: (optional) entity, will be used as source for damage done by the explosion

View File

@ -1,472 +0,0 @@
--[[
Explosion API mod for Minetest (adapted to MineClone 2)
This mod is based on the Minetest explosion API mod, but has been changed
to have the same explosion mechanics as Minecraft and work with MineClone.
The computation-intensive parts of the mod has been optimized to allow for
larger explosions and faster world updating.
This mod was created by Elias Astrom <ryvnf@riseup.net> and is released
under the LGPLv2.1 license.
--]]
mcl_explosions = {}
local mod_fire = minetest.get_modpath("mcl_fire")
--local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire")
local math = math
local vector = vector
local table = table
local hash_node_position = minetest.hash_node_position
local get_objects_inside_radius = minetest.get_objects_inside_radius
local get_position_from_hash = minetest.get_position_from_hash
local get_node_drops = minetest.get_node_drops
local get_name_from_content_id = minetest.get_name_from_content_id
local get_voxel_manip = minetest.get_voxel_manip
local bulk_set_node = minetest.bulk_set_node
local check_for_falling = minetest.check_for_falling
local add_item = minetest.add_item
local pos_to_string = minetest.pos_to_string
-- Saved sphere explosion shapes for various radiuses
local sphere_shapes = {}
-- Saved node definitions in table using cid-keys for faster look-up.
local node_blastres = {}
local node_on_blast = {}
local node_walkable = {}
-- The step length for the rays (Minecraft uses 0.3)
local STEP_LENGTH = 0.3
-- How many rays to compute entity exposure to explosion
local N_EXPOSURE_RAYS = 16
-- Nodes having a blast resistance of this value or higher are treated as
-- indestructible
local INDESTRUCT_BLASTRES = 1000000
minetest.register_on_mods_loaded(function()
-- Store blast resistance values by content ids to improve performance.
for name, def in pairs(minetest.registered_nodes) do
local id = minetest.get_content_id(name)
node_blastres[id] = def._mcl_blast_resistance or 0
node_on_blast[id] = def.on_blast
node_walkable[id] = def.walkable
end
end)
-- Compute the rays which make up a sphere with radius. Returns a list of rays
-- which can be used to trace explosions. This function is not efficient
-- (especially for larger radiuses), so the generated rays for various radiuses
-- should be cached and reused.
--
-- Should be possible to improve by using a midpoint circle algorithm multiple
-- times to create the sphere, currently uses more of a brute-force approach.
local function compute_sphere_rays(radius)
local rays = {}
local sphere = {}
local function add_ray(pos)
sphere[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, 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 _, pos in pairs(sphere) do
rays[#rays + 1] = vector.normalize(pos)
end
return rays
end
-- Add particles from explosion
--
-- Parameters:
-- pos - The position of the explosion
-- radius - The radius of the explosion
local function add_particles(pos, radius)
minetest.add_particlespawner({
amount = 64,
time = 0.125,
minpos = pos,
maxpos = pos,
minvel = {x = -radius, y = -radius, z = -radius},
maxvel = {x = radius, y = radius, z = radius},
minacc = vector.new(),
maxacc = vector.new(),
minexptime = 0.5,
maxexptime = 1.0,
minsize = radius * 0.5,
maxsize = radius * 1.0,
texture = "mcl_particles_smoke.png",
})
end
-- Traces the rays of an explosion, and updates the environment.
--
-- Parameters:
-- pos - Where the rays in the explosion should start from
-- strength - The strength of each ray
-- raydirs - The directions for each ray
-- radius - The maximum distance each ray will go
-- info - Table containing information about explosion
-- direct - direct source object of the damage (optional)
-- source - indirect source object of the damage (optional)
--
-- Values in info:
-- drop_chance - The chance that destroyed nodes will drop their items
-- fire - If true, 1/3 nodes become fire
-- griefing - If true, the explosion will destroy nodes (default: true)
-- max_blast_resistance - The explosion will treat all non-indestructible nodes
-- as having a blast resistance of no more than this
-- value
-- grief_protected - If true, the explosion will also destroy nodes which have
-- been protected
--
-- Note that this function has been optimized, it contains code which has been
-- inlined to avoid function calls and unnecessary table creation. This was
-- measured to give a significant performance increase.
local function trace_explode(pos, strength, raydirs, radius, info, direct, source)
local vm = get_voxel_manip()
local emin, emax = vm:read_from_map(vector.subtract(pos, radius),
vector.add(pos, radius))
local emin_x = emin.x
local emin_y = emin.y
local emin_z = emin.z
local ystride = (emax.x - emin_x + 1)
local zstride = ystride * (emax.y - emin_y + 1)
--[[local area = VoxelArea:new {
MinEdge = emin,
MaxEdge = emax
}]]
local data = vm:get_data()
local destroy = {}
local drop_chance = info.drop_chance
local fire = info.fire
local max_blast_resistance = info.max_blast_resistance
local grief_protected = info.grief_protected
-- Trace rays for environment destruction
if info.griefing then
for i = 1, #raydirs do
local rpos_x = pos.x
local rpos_y = pos.y
local rpos_z = pos.z
local rdir_x = raydirs[i].x
local rdir_y = raydirs[i].y
local rdir_z = raydirs[i].z
local rstr = (0.7 + math.random() * 0.6) * strength
for r = 0, math.ceil(radius * (1.0 / STEP_LENGTH)) do
local npos_x = math.floor(rpos_x + 0.5)
local npos_y = math.floor(rpos_y + 0.5)
local npos_z = math.floor(rpos_z + 0.5)
local npos = { x = npos_x, y = npos_y, z = npos_z }
local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride +
npos_x - emin_x + 1
local cid = data[idx]
local br = node_blastres[cid] or INDESTRUCT_BLASTRES
if br < INDESTRUCT_BLASTRES and br > max_blast_resistance then
br = max_blast_resistance
end
local hash = hash_node_position(npos)
rpos_x = rpos_x + STEP_LENGTH * rdir_x
rpos_y = rpos_y + STEP_LENGTH * rdir_y
rpos_z = rpos_z + STEP_LENGTH * rdir_z
rstr = rstr - 0.75 * STEP_LENGTH - (br + 0.3) * STEP_LENGTH
if rstr <= 0 then
break
end
if cid ~= minetest.CONTENT_AIR then
if not minetest.is_protected(npos, "") or grief_protected then
destroy[hash] = idx
end
end
end
end
end
-- Entities in radius of explosion
local punch_radius = 2 * strength
local objs = get_objects_inside_radius(pos, punch_radius)
-- Trace rays for entity damage
for _, obj in pairs(objs) do
local ent = obj:get_luaentity()
-- Ignore items to lower lag
if (obj:is_player() or (ent and ent.name ~= "__builtin.item")) and obj:get_hp() > 0 then
local opos = obj:get_pos()
local collisionbox = nil
if obj:is_player() then
collisionbox = { -0.3, 0.0, -0.3, 0.3, 1.77, 0.3 }
elseif ent.name then
local def = minetest.registered_entities[ent.name]
collisionbox = def.collisionbox
end
if collisionbox then
-- Create rays from random points in the collision box
local x1 = collisionbox[1]
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)
-- Move object position to the center of its bounding box
opos.x = opos.x + 0.5 * (x1 + x2)
opos.y = opos.y + 0.5 * (y1 + y2)
opos.z = opos.z + 0.5 * (z1 + z2)
-- Count number of rays from collision box which are unobstructed
local count = N_EXPOSURE_RAYS
for i = 1, N_EXPOSURE_RAYS do
local rpos_x = opos.x + math.random() * x_len - x_len / 2
local rpos_y = opos.y + math.random() * y_len - y_len / 2
local rpos_z = opos.z + math.random() * z_len - z_len / 2
local rdir_x = pos.x - rpos_x
local rdir_y = pos.y - rpos_y
local rdir_z = pos.z - rpos_z
local rdir_len = math.hypot(rdir_x, math.hypot(rdir_y, rdir_z))
rdir_x = rdir_x / rdir_len
rdir_y = rdir_y / rdir_len
rdir_z = rdir_z / rdir_len
for i=0, rdir_len / STEP_LENGTH do
rpos_x = rpos_x + rdir_x * STEP_LENGTH
rpos_y = rpos_y + rdir_y * STEP_LENGTH
rpos_z = rpos_z + rdir_z * STEP_LENGTH
local npos_x = math.floor(rpos_x + 0.5)
local npos_y = math.floor(rpos_y + 0.5)
local npos_z = math.floor(rpos_z + 0.5)
local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride +
npos_x - emin_x + 1
local cid = data[idx]
local walkable = node_walkable[cid]
if walkable then
count = count - 1
break
end
end
end
-- Punch entity with damage depending on explosion exposure and
-- distance to explosion
local exposure = count / N_EXPOSURE_RAYS
local punch_vec = vector.subtract(opos, pos)
local punch_dir = vector.normalize(punch_vec)
local impact = (1 - vector.length(punch_vec) / punch_radius) * exposure
if impact < 0 then
impact = 0
end
local damage = math.floor((impact * impact + impact) * 7 * strength + 1)
local sleep_formspec_doesnt_close_mt53 = false
if obj:is_player() then
local name = obj:get_player_name()
if mcl_beds then
local meta = obj:get_meta()
if meta:get_string("mcl_beds:sleeping") == "true" then
minetest.close_formspec(name, "") -- ABSOLUTELY NECESSARY FOR MT5.3 -- TODO: REMOVE THIS IN THE FUTURE
sleep_formspec_doesnt_close_mt53 = true
end
end
end
if sleep_formspec_doesnt_close_mt53 then
minetest.after(0.3, function() -- 0.2 is minimum delay for closing old formspec and open died formspec -- TODO: REMOVE THIS IN THE FUTURE
if not obj:is_player() then
return
end
mcl_util.deal_damage(obj, damage, {type = "explosion", direct = direct, source = source})
obj:add_velocity(vector.multiply(punch_dir, impact * 20))
end)
else
mcl_util.deal_damage(obj, damage, {type = "explosion", direct = direct, source = source})
if obj:is_player() or ent.tnt_knockback then
obj:add_velocity(vector.multiply(punch_dir, impact * 20))
end
end
end
end
end
local airs, fires = {}, {}
-- Remove destroyed blocks and drop items
for hash, idx in pairs(destroy) do
local do_drop = math.random() <= drop_chance
local on_blast = node_on_blast[data[idx]]
local remove = true
if do_drop or on_blast then
local npos = get_position_from_hash(hash)
if on_blast then
on_blast(npos, 1.0, do_drop)
remove = false
else
local name = get_name_from_content_id(data[idx])
local drop = get_node_drops(name, "")
for _, item in ipairs(drop) do
if type(item) ~= "string" then
item = item:get_name() .. item:get_count()
end
add_item(npos, item)
end
end
end
if remove then
if mod_fire and fire and math.random(1, 3) == 1 then
table.insert(fires, get_position_from_hash(hash))
else
table.insert(airs, get_position_from_hash(hash))
end
end
end
-- We use bulk_set_node instead of LVM because we want to have on_destruct and
-- on_construct being called
if #airs > 0 then
bulk_set_node(airs, {name="air"})
end
if #fires > 0 then
bulk_set_node(fires, {name="mcl_fire:fire"})
end
-- Update falling nodes
for a=1, #airs do
local p = airs[a]
check_for_falling({x=p.x, y=p.y+1, z=p.z})
end
for f=1, #fires do
local p = fires[f]
check_for_falling({x=p.x, y=p.y+1, z=p.z})
end
-- Log explosion
minetest.log("action", "Explosion at "..pos_to_string(pos).." with strength "..strength.." and radius "..radius)
end
-- Create an explosion with strength at pos.
--
-- Parameters:
-- pos - The position where the explosion originates from
-- strength - The blast strength of the explosion (a TNT explosion uses 4)
-- info - Table containing information about explosion
-- direct - direct source object of the damage (optional)
-- source - indirect source object of the damage (optional)
--
-- Values in info:
-- drop_chance - If specified becomes the drop chance of all nodes in the
-- explosion (default: 1.0 / strength)
-- max_blast_resistance - If specified the explosion will treat all
-- non-indestructible nodes as having a blast resistance
-- of no more than this value
-- sound - If true, the explosion will play a sound (default: true)
-- particles - If true, the explosion will create particles (default: true)
-- fire - If true, 1/3 nodes become fire (default: false)
-- griefing - If true, the explosion will destroy nodes (default: true)
-- grief_protected - If true, the explosion will also destroy nodes which have
-- been protected (default: false)
function mcl_explosions.explode(pos, strength, info, direct, source)
if info == nil then
info = {}
end
-- The maximum blast radius (in the air)
local radius = math.ceil(1.3 * strength / (0.3 * 0.75) * 0.3)
if not sphere_shapes[radius] then
sphere_shapes[radius] = compute_sphere_rays(radius)
end
local shape = sphere_shapes[radius]
-- Default values
if info.drop_chance == nil then info.drop_chance = 1 / strength end
if info.particles == nil then info.particles = true end
if info.sound == nil then info.sound = true end
if info.fire == nil then info.fire = false end
if info.griefing == nil then info.griefing = true end
if info.grief_protected == nil then info.grief_protected = false end
if info.max_blast_resistance == nil then
info.max_blast_resistance = INDESTRUCT_BLASTRES
end
-- Dont do drops in creative mode
if minetest.is_creative_enabled("") then
info.drop_chance = 0
end
trace_explode(pos, strength, shape, radius, info, direct, source)
if info.particles then
add_particles(pos, radius)
end
if info.sound then
minetest.sound_play("tnt_explode", {
pos = pos, gain = 1.0,
max_hear_distance = strength * 16
}, true)
end
end

View File

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

View File

@ -1,5 +0,0 @@
name = mcl_explosions
author = ryvnf
description = A common API to create explosions.
depends = mcl_particles
optional_depends = mcl_fire

View File

@ -1,263 +0,0 @@
-- Some global variables (don't overwrite them!)
mcl_vars = {}
mcl_vars.redstone_tick = 0.1
--- GUI / inventory menu settings
mcl_vars.gui_slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]"
-- nonbg is added as formspec prepend in mcl_formspec_prepend
mcl_vars.gui_nonbg = mcl_vars.gui_slots ..
"style_type[image_button;border=false;bgimg=mcl_inventory_button9.png;bgimg_pressed=mcl_inventory_button9_pressed.png;bgimg_middle=2,2]"..
"style_type[button;border=false;bgimg=mcl_inventory_button9.png;bgimg_pressed=mcl_inventory_button9_pressed.png;bgimg_middle=2,2]"..
"style_type[field;textcolor=#323232]"..
"style_type[label;textcolor=#323232]"..
"style_type[textarea;textcolor=#323232]"..
"style_type[checkbox;textcolor=#323232]"
-- Background stuff must be manually added by mods (no formspec prepend)
mcl_vars.gui_bg_color = "bgcolor[#00000000]"
mcl_vars.gui_bg_img = "background9[1,1;1,1;mcl_base_textures_background9.png;true;7]"
-- Legacy
mcl_vars.inventory_header = ""
-- Tool wield size
mcl_vars.tool_wield_scale = { x = 1.8, y = 1.8, z = 1 }
-- Mapgen variables
local mg_name = minetest.get_mapgen_setting("mg_name")
local minecraft_height_limit = 256
local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true"
local singlenode = mg_name == "singlenode"
-- Calculate mapgen_edge_min/mapgen_edge_max
mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5)
mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16)
mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000)
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, minetest.MAX_MAP_GENERATION_LIMIT or 31000)
local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2)
mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
mcl_vars.chunk_size_in_nodes = mcl_vars.chunksize * mcl_vars.MAP_BLOCKSIZE
local central_chunk_min_pos = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
local central_chunk_max_pos = central_chunk_min_pos + mcl_vars.chunk_size_in_nodes - 1
local ccfmin = central_chunk_min_pos - mcl_vars.MAP_BLOCKSIZE -- Fullminp/fullmaxp of central chunk, in nodes
local ccfmax = central_chunk_max_pos + mcl_vars.MAP_BLOCKSIZE
local mapgen_limit_b = math.floor(math.min(mcl_vars.mapgen_limit, mcl_vars.MAX_MAP_GENERATION_LIMIT) / mcl_vars.MAP_BLOCKSIZE)
local mapgen_limit_min = -mapgen_limit_b * mcl_vars.MAP_BLOCKSIZE
local mapgen_limit_max = (mapgen_limit_b + 1) * mcl_vars.MAP_BLOCKSIZE - 1
local numcmin = math.max(math.floor((ccfmin - mapgen_limit_min) / mcl_vars.chunk_size_in_nodes), 0) -- Number of complete chunks from central chunk
local numcmax = math.max(math.floor((mapgen_limit_max - ccfmax) / mcl_vars.chunk_size_in_nodes), 0) -- fullminp/fullmaxp to effective mapgen limits.
mcl_vars.mapgen_edge_min = central_chunk_min_pos - numcmin * mcl_vars.chunk_size_in_nodes
mcl_vars.mapgen_edge_max = central_chunk_max_pos + numcmax * mcl_vars.chunk_size_in_nodes
local function coordinate_to_block(x)
return math.floor(x / mcl_vars.MAP_BLOCKSIZE)
end
local function coordinate_to_chunk(x)
return math.floor((coordinate_to_block(x) - central_chunk_offset) / mcl_vars.chunksize)
end
function mcl_vars.pos_to_block(pos)
return {
x = coordinate_to_block(pos.x),
y = coordinate_to_block(pos.y),
z = coordinate_to_block(pos.z)
}
end
function mcl_vars.pos_to_chunk(pos)
return {
x = coordinate_to_chunk(pos.x),
y = coordinate_to_chunk(pos.y),
z = coordinate_to_chunk(pos.z)
}
end
local k_positive = math.ceil(mcl_vars.MAX_MAP_GENERATION_LIMIT / mcl_vars.chunk_size_in_nodes)
local k_positive_z = k_positive * 2
local k_positive_y = k_positive_z * k_positive_z
function mcl_vars.get_chunk_number(pos) -- unsigned int
local c = mcl_vars.pos_to_chunk(pos)
return
(c.y + k_positive) * k_positive_y +
(c.z + k_positive) * k_positive_z +
c.x + k_positive
end
if not superflat and not singlenode then
-- Normal mode
--[[ Realm stacking (h is for height)
- Overworld (h>=256)
- Void (h>=1000)
- Realm Barrier (h=11), to allow escaping the End
- End (h>=256)
- Void (h>=1000)
- Nether (h=128)
- Void (h>=1000)
]]
-- Overworld
mcl_vars.mg_overworld_min = -62
mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min + 4
mcl_vars.mg_lava_overworld_max = mcl_vars.mg_overworld_min + 10
mcl_vars.mg_lava = true
mcl_vars.mg_bedrock_is_rough = true
elseif singlenode then
mcl_vars.mg_overworld_min = -66
mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min
mcl_vars.mg_lava = false
mcl_vars.mg_lava_overworld_max = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_is_rough = false
else
-- Classic superflat
local ground = minetest.get_mapgen_setting("mgflat_ground_level")
ground = tonumber(ground)
if not ground then
ground = 8
end
mcl_vars.mg_overworld_min = ground - 3
mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min
mcl_vars.mg_lava = false
mcl_vars.mg_lava_overworld_max = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_is_rough = false
end
mcl_vars.mg_overworld_max = mcl_vars.mapgen_edge_max
-- The Nether (around Y = -29000)
mcl_vars.mg_nether_min = -29067 -- Carefully chosen to be at a mapchunk border
mcl_vars.mg_nether_max = mcl_vars.mg_nether_min + 128
mcl_vars.mg_bedrock_nether_bottom_min = mcl_vars.mg_nether_min
mcl_vars.mg_bedrock_nether_top_max = mcl_vars.mg_nether_max
if not superflat then
mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min + 4
mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max - 4
mcl_vars.mg_lava_nether_max = mcl_vars.mg_nether_min + 31
else
-- Thin bedrock in classic superflat mapgen
mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min
mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max
mcl_vars.mg_lava_nether_max = mcl_vars.mg_nether_min + 2
end
if mg_name == "flat" then
if superflat then
mcl_vars.mg_flat_nether_floor = mcl_vars.mg_bedrock_nether_bottom_max + 4
mcl_vars.mg_flat_nether_ceiling = mcl_vars.mg_bedrock_nether_bottom_max + 52
else
mcl_vars.mg_flat_nether_floor = mcl_vars.mg_lava_nether_max + 4
mcl_vars.mg_flat_nether_ceiling = mcl_vars.mg_lava_nether_max + 52
end
end
-- The End (surface at ca. Y = -27000)
mcl_vars.mg_end_min = -27073 -- Carefully chosen to be at a mapchunk border
mcl_vars.mg_end_max_official = mcl_vars.mg_end_min + minecraft_height_limit
mcl_vars.mg_end_max = mcl_vars.mg_overworld_min - 2000
mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 74, z = 0 }
-- Realm barrier used to safely separate the End from the void below the Overworld
mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max
mcl_vars.mg_realm_barrier_overworld_end_min = mcl_vars.mg_end_max - 11
-- Use MineClone 2-style dungeons
mcl_vars.mg_dungeons = true
-- Set default stack sizes
minetest.nodedef_default.stack_max = 64
minetest.craftitemdef_default.stack_max = 64
-- Set random seed for all other mods (Remember to make sure no other mod calls this function)
math.randomseed(os.time())
local chunks = {} -- intervals of chunks generated
function mcl_vars.add_chunk(pos)
local n = mcl_vars.get_chunk_number(pos) -- unsigned int
local prev
for i, d in pairs(chunks) do
if n <= d[2] then -- we've found it
if (n == d[2]) or (n >= d[1]) then return end -- already here
if n == d[1]-1 then -- right before:
if prev and (prev[2] == n-1) then
prev[2] = d[2]
table.remove(chunks, i)
return
end
d[1] = n
return
end
if prev and (prev[2] == n-1) then --join to previous
prev[2] = n
return
end
table.insert(chunks, i, {n, n}) -- insert new interval before i
return
end
prev = d
end
chunks[#chunks+1] = {n, n}
end
function mcl_vars.is_generated(pos)
local n = mcl_vars.get_chunk_number(pos) -- unsigned int
for i, d in pairs(chunks) do
if n <= d[2] then
return (n >= d[1])
end
end
return false
end
-- "Trivial" (actually NOT) function to just read the node and some stuff to not just return "ignore", like mt 5.4 does.
-- p: Position, if it's wrong, {name="error"} node will return.
-- force: optional (default: false) - Do the maximum to still read the node within us_timeout.
-- us_timeout: optional (default: 244 = 0.000244 s = 1/80/80/80), set it at least to 3000000 to let mapgen to finish its job.
--
-- returns node definition, eg. {name="air"}. Unfortunately still can return {name="ignore"}.
function mcl_vars.get_node(p, force, us_timeout)
-- check initial circumstances
if not p or not p.x or not p.y or not p.z then return {name="error"} end
-- try common way
local node = minetest.get_node(p)
if node.name ~= "ignore" then
return node
end
-- copy table to get sure it won't changed by other threads
local pos = {x=p.x,y=p.y,z=p.z}
-- try LVM
minetest.get_voxel_manip():read_from_map(pos, pos)
node = minetest.get_node(pos)
if node.name ~= "ignore" or not force then
return node
end
-- all ways failed - need to emerge (or forceload if generated)
local us_timeout = us_timeout or 244
if mcl_vars.is_generated(pos) then
minetest.chat_send_all("IMPOSSIBLE! Please report this to MCL2 issue tracker!")
minetest.forceload_block(pos)
else
minetest.emerge_area(pos, pos)
end
local t = minetest.get_us_time()
node = minetest.get_node(pos)
while (not node or node.name == "ignore") and (minetest.get_us_time() - t < us_timeout) do
node = minetest.get_node(pos)
end
return node
-- it still can return "ignore", LOL, even if force = true, but only after time out
end

View File

@ -1,3 +0,0 @@
name = mcl_init
author = Wuzzy
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,159 +0,0 @@
mcl_loot = {}
--[[
Select a number of itemstacks out of a pool of treasure definitions randomly.
Parameters:
* loot_definitions: Probabilities and information about the loot to select. Syntax:
{
stacks_min = 1, -- Minimum number of item stacks to get. Default: 1
stacks_max = 3, -- Maximum number of item stacks to get. Default: 1
items = { -- Table of possible loot items. This function selects between stacks_min and stacks_max of these.
{
weight = 5, -- Likelihood of this item being selected (see below). Optional (default: 1)
itemstack = ItemStack("example:item1"), -- Itemstack to select
-- OR
itemstring = "example:item1", -- Which item to select
amount_min = 1, -- Minimum size of itemstack. Must not be larger than 6553. Optional (default: 1)
amount_max = 10, -- Maximum size of item stack. Must not be larger than item definition's stack_max or 6553. Optional (default: 1)
wear_min = 1, -- Minimum wear value. Must be at least 1. Optional (default: no wear)
wear_max = 1, -- Maxiumum wear value. Must be at least 1. Optional (default: no wear)
},
{ -- more tables like above, one table per item stack }
}
}
* pr: PseudoRandom object used for the randomness
How weight works: The probability of a single item stack being selected is weight/total_weight, with
total_weight being the sum of all weight values in the items table. If you leave out the weight for
all items, the likelihood of each item being selected is equal.
Returns: Table of itemstrings
]]
function mcl_loot.get_loot(loot_definitions, pr)
local items = {}
local total_weight = 0
for i=1, #loot_definitions.items do
total_weight = total_weight + (loot_definitions.items[i].weight or 1)
end
--local stacks_min = loot_definitions.stacks_min or 1
--local stacks_max = loot_definitions.stacks_max or 1
local stacks = pr:next(loot_definitions.stacks_min, loot_definitions.stacks_max)
for s=1, stacks do
local r = pr:next(1, total_weight)
local accumulated_weight = 0
local item
for i=1, #loot_definitions.items do
accumulated_weight = accumulated_weight + (loot_definitions.items[i].weight or 1)
if accumulated_weight >= r then
item = loot_definitions.items[i]
break
end
end
if item then
local itemstring = item.itemstring
if itemstring then
local stack = ItemStack(itemstring)
if item.amount_min and item.amount_max then
stack:set_count(pr:next(item.amount_min, item.amount_max))
end
if item.wear_min and item.wear_max then
-- Sadly, PseudoRandom only allows very narrow ranges, so we set wear in steps of 10
local wear_min = math.floor(item.wear_min / 10)
local wear_max = math.floor(item.wear_max / 10)
stack:set_wear(pr:next(wear_min, wear_max) * 10)
end
if item.func then
item.func(stack, pr)
end
table.insert(items, stack)
else
minetest.log("error", "[mcl_loot] INTERNAL ERROR! Failed to select random loot item!")
end
end
end
return items
end
--[[
Repeat mcl_loot.get_loot multiple times for various loot_definitions.
Useful for filling chests.
* multi_loot_definitions: Table of loot_definitions (see mcl_loot.get_loot)
* pr: PseudoRandom object used for the randomness
Returns: Table of itemstrings ]]
function mcl_loot.get_multi_loot(multi_loot_definitions, pr)
local items = {}
for m=1, #multi_loot_definitions do
local group = mcl_loot.get_loot(multi_loot_definitions[m], pr)
for g=1, #group do
table.insert(items, group[g])
end
end
return items
end
--[[
Returns a table of length `max_slot` and all natural numbers between 1 and `max_slot`
in a random order.
]]
local function get_random_slots(max_slot, pr)
local slots = {}
for s=1, max_slot do
slots[s] = s
end
local slots_out = {}
while #slots > 0 do
local r = pr and pr:next(1, #slots) or math.random(1, #slots)
table.insert(slots_out, slots[r])
table.remove(slots, r)
end
return slots_out
end
--[[
Puts items in an inventory list into random slots.
* inv: InvRef
* listname: Inventory list name
* items: table of items to add
Items will be added from start of the table to end.
If the inventory already has occupied slots, or is
too small, placement of some items might fail.
]]
function mcl_loot.fill_inventory(inv, listname, items, pr)
local size = inv:get_size(listname)
local slots = get_random_slots(size, pr)
local leftovers = {}
-- 1st pass: Add items into random slots
for i=1, math.min(#items, size) do
local item = items[i]
local slot = slots[i]
local old_item = inv:get_stack(listname, slot)
local leftover = old_item:add_item(item)
inv:set_stack(listname, slot, old_item)
if not leftover:is_empty() then
table.insert(leftovers, item)
end
end
-- 2nd pass: If some items couldn't be added in first pass,
-- try again in a non-random fashion
for l=1, math.min(#leftovers, size) do
inv:add_item(listname, leftovers[l])
end
-- If there are still items left, tough luck!
end

View File

@ -1,3 +0,0 @@
name = mcl_loot
author = Wuzzy
description = API for filling a chest with random treasures.

View File

@ -1,131 +0,0 @@
local vector = vector
local table = table
local hash_node_position = minetest.hash_node_position
local add_particlespawner = minetest.add_particlespawner
local delete_particlespawner = minetest.delete_particlespawner
local ipairs = ipairs
mcl_particles = {}
-- Table of particlespawner IDs on a per-node hash basis
-- Keys: node position hashes
-- Values: Tables of particlespawner IDs (each node pos can have an arbitrary number of particlespawners)
local particle_nodes = {}
-- Node particles can be disabled via setting
local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none"
local levels = {
high = 3,
medium = 2,
low = 1,
none = 0,
}
allowed_level = levels[node_particles_allowed]
if not allowed_level then
allowed_level = levels["none"]
end
-- Add a particlespawner that is assigned to a given node position.
-- * pos: Node positon. MUST use integer values!
-- * particlespawner_definition: definition for minetest.add_particlespawner
-- * level: detail level of particles. "high", "medium", "low" or "none". High detail levels are for
-- CPU-demanding particles, like smoke of fire (which occurs frequently)
-- NOTE: All particlespawners are automatically removed on shutdown.
-- Returns particlespawner ID on succcess and nil on failure
function mcl_particles.add_node_particlespawner(pos, particlespawner_definition, level)
if allowed_level == 0 or levels[level] > allowed_level then
return
end
local poshash = hash_node_position(pos)
if not poshash then
return
end
local id = add_particlespawner(particlespawner_definition)
if id == -1 then
return
end
if not particle_nodes[poshash] then
particle_nodes[poshash] = {}
end
table.insert(particle_nodes[poshash], id)
return id
end
local add_node_particlespawner = mcl_particles.add_node_particlespawner
-- Deletes all particlespawners that are assigned to a node position.
-- If no particlespawners exist for this position, nothing happens.
-- pos: Node positon. MUST use integer values!
-- Returns true if particlespawner could be removed and false if not
function mcl_particles.delete_node_particlespawners(pos)
if allowed_level == 0 then
return false
end
local poshash = hash_node_position(pos)
local ids = particle_nodes[poshash]
if ids then
for i=1, #ids do
delete_particlespawner(ids[i])
end
particle_nodes[poshash] = nil
return true
end
return false
end
-- 3 exptime variants because the animation is not tied to particle expiration time.
-- 3 colorized variants to imitate minecraft's
local smoke_pdef_cached = {}
function mcl_particles.spawn_smoke(pos, name, smoke_pdef_base)
local new_minpos = vector.add(pos, smoke_pdef_base.minrelpos)
local new_maxpos = vector.add(pos, smoke_pdef_base.maxrelpos)
-- populate the cache
if smoke_pdef_cached[name] then
for i, smoke_pdef in ipairs(smoke_pdef_cached[name]) do
smoke_pdef.minpos = new_minpos
smoke_pdef.maxpos = new_maxpos
add_node_particlespawner(pos, smoke_pdef, "high")
end
-- cache already populated
else
smoke_pdef_cached[name] = {}
local smoke_pdef = table.copy(smoke_pdef_base)
smoke_pdef.amount = smoke_pdef_base.amount / 9
smoke_pdef.time = 0
smoke_pdef.animation = {
type = "vertical_frames",
aspect_w = 8,
aspect_h = 8,
-- length = 3 exptime variants
}
smoke_pdef.collisiondetection = true
smoke_pdef.minpos = new_minpos
smoke_pdef.maxpos = new_maxpos
-- the last frame plays for 1/8 * N seconds, so we can take advantage of it
-- to have varying exptime for each variant.
local exptimes = { 0.175, 0.375, 1.0 }
local colorizes = { "199", "209", "243" } -- round(78%, 82%, 90% of 256) - 1
for _,exptime in ipairs(exptimes) do
for _,colorize in ipairs(colorizes) do
smoke_pdef.maxexptime = exptime * smoke_pdef_base.maxexptime
smoke_pdef.animation.length = exptime + 0.1
-- minexptime must be set such that the last frame is actully rendered,
-- even if its very short. Larger exptime -> larger range
smoke_pdef.minexptime = math.min(exptime, (7.0/8.0 * (exptime + 0.1) + 0.1))
smoke_pdef.texture = "mcl_particles_smoke_anim.png^[colorize:#000000:" ..colorize
add_node_particlespawner(pos, smoke_pdef, "high")
table.insert(smoke_pdef_cached[name], table.copy(smoke_pdef))
end
end
end
end

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

View File

@ -1,97 +0,0 @@
Licenses of sounds
-----------------
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
http://creativecommons.org/licenses/by-sa/4.0/
Creative Commons Attribution 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by/3.0/
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/
3: http://www.freesound.org/people/lsprice/sounds/88808/
default_tool_breaks.ogg by EdgardEdition (CC BY 3.0), http://www.freesound.org/people/EdgardEdition
Mito551 (sounds) (CC BY-SA 3.0):
default_dig_choppy.ogg
default_dig_cracky.ogg
default_dig_crumbly.1.ogg
default_dig_crumbly.2.ogg
default_dig_oddly_breakable_by_hand.ogg
default_dug_node.1.ogg
default_dug_node.2.ogg
default_grass_footstep.1.ogg
default_grass_footstep.2.ogg
default_grass_footstep.3.ogg
default_gravel_footstep.1.ogg
default_gravel_footstep.2.ogg
default_gravel_footstep.3.ogg
default_gravel_footstep.4.ogg
default_grass_footstep.1.ogg
default_place_node.1.ogg
default_place_node.2.ogg
default_place_node.3.ogg
default_place_node_hard.1.ogg
default_place_node_hard.2.ogg
default_hard_footstep.1.ogg
default_hard_footstep.2.ogg
default_hard_footstep.3.ogg
default_sand_footstep.1.ogg
default_sand_footstep.2.ogg
default_wood_footstep.1.ogg
default_wood_footstep.2.ogg
default_dirt_footstep.1.ogg
default_dirt_footstep.2.ogg
default_glass_footstep.ogg
Metal sounds:
default_dig_metal.ogg - yadronoff - CC-BY-3.0
- https://www.freesound.org/people/yadronoff/sounds/320397/
default_dug_metal.*.ogg - Iwan Gabovitch - qubodup - CC0
- http://opengameart.org/users/qubodup
default_metal_footstep.*.ogg - Ottomaani138 - CC0
- https://www.freesound.org/people/Ottomaani138/sounds/232692/
default_place_node_metal.*.ogg - Ogrebane - CC0
- http://opengameart.org/content/wood-and-metal-sound-effects-volume-2
AGFX (CC BY 3.0)
https://www.freesound.org/people/AGFX/packs/1253/
default_water_footstep.1.ogg
default_water_footstep.2.ogg
default_water_footstep.3.ogg
(default_water_footstep.4.ogg is silent)
blukotek (CC0 1.0)
https://www.freesound.org/people/blukotek/sounds/251660/
default_dig_snappy.ogg
sonictechtonic (CC BY 3.0)
https://www.freesound.org/people/sonictechtonic/sounds/241872/
player_damage.ogg
Voxelands project <http://www.voxelands.com/> (CC BY-SA 3.0)
mcl_sounds_place_node_water.ogg
mcl_sounds_dug_water.ogg
(Note: Artists from the Voxelands project include: sdzen, darkrose, sapier,
Tom Peter, Telaron, juskiddink)
Michel Baradari <https://opengameart.org/content/lava-splash> (CC BY 3.0)
default_place_node_lava.ogg
Adam_N (CC0 1.0):
player_falling_damage.ogg
Source: <https://www.freesound.org/people/Adam_N/sounds/346692/>
Alecia Shepherd (CC BY-SA 4.0):
mcl_sounds_cloth.ogg
Source: SnowSong sound and music pack <https://opengameart.org/content/snowsong-sound-and-music-pack>
Unknown authors (WTFPL):
pedology_snow_soft_footstep.*.ogg

View File

@ -1,168 +0,0 @@
--
-- Sounds
--
mcl_sounds = {}
function mcl_sounds.node_sound_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="", gain=1.0}
table.dug = table.dug or
{name="default_dug_node", gain=0.25}
table.dig = table.dig or
{name="default_dig_oddly_breakable_by_hand", gain=1.0}
table.place = table.place or
{name="default_place_node_hard", gain=1.0}
return table
end
function mcl_sounds.node_sound_stone_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.5}
table.dug = table.dug or
{name="default_hard_footstep", gain=1.0}
table.dig = table.dig or
{name="default_dig_cracky", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_metal_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_metal_footstep", gain=0.5}
table.dug = table.dug or
{name="default_dug_metal", gain=1.0}
table.dig = table.dig or
{name="default_dig_metal", gain=1.0}
table.place = table.place or
{name="default_place_node_metal", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_dirt_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_dirt_footstep", gain=1.0}
table.dug = table.dug or
{name="default_dirt_footstep", gain=1.5}
table.dig = table.dig or
{name="default_dig_crumbly", gain=1.0}
table.place = table.place or
{name="default_place_node", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_sand_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_sand_footstep", gain=0.5}
table.dug = table.dug or
{name="default_sand_footstep", gain=1.0}
table.dig = table.dig or
{name="default_dig_crumbly", gain=1.0}
table.place = table.place or
{name="default_place_node", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_snow_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="pedology_snow_soft_footstep", gain=0.5}
table.dug = table.dug or
{name="pedology_snow_soft_footstep", gain=1.0}
table.dig = table.dig or
{name="default_dig_crumbly", gain=1.0}
table.place = table.place or
{name="default_place_node", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_wood_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_wood_footstep", gain=0.5}
table.dug = table.dug or
{name="default_wood_footstep", gain=1.0}
table.dig = table.dig or
{name="default_dig_choppy", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_wool_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="mcl_sounds_cloth", gain=0.5}
table.dug = table.dug or
{name="mcl_sounds_cloth", gain=1.0}
table.dig = table.dig or
{name="mcl_sounds_cloth", gain=0.9}
table.place = table.dig or
{name="mcl_sounds_cloth", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_leaves_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.1325}
table.dug = table.dug or
{name="default_grass_footstep", gain=0.425}
table.dig = table.dig or
{name="default_dig_snappy", gain=0.4}
table.place = table.place or
{name="default_place_node", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_glass_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_glass_footstep", gain=0.5}
table.dug = table.dug or
{name="default_break_glass", gain=1.0}
table.dig = table.dig or
{name="default_dig_cracky", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_water_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_water_footstep", gain = 0.2}
table.place = table.place or
{name = "mcl_sounds_place_node_water", gain = 1.0}
table.dug = table.dug or
{name = "mcl_sounds_dug_water", gain = 1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_lava_defaults(table)
table = table or {}
-- TODO: Footstep
table.place = table.place or
{name = "default_place_node_lava", gain = 1.0}
table.dug = table.dug or
{name = "default_place_node_lava", gain = 1.0}
-- TODO: Different dug sound
mcl_sounds.node_sound_defaults(table)
return table
end
-- Player death sound
minetest.register_on_dieplayer(function(player)
-- TODO: Add separate death sound
minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16}, true)
end)

View File

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

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