Compare commits

...

718 Commits

Author SHA1 Message Date
epCode 3a174b2230 Fix rocket glitch 2021-10-15 12:00:16 -07:00
epCode 570f9bf8c4 Addmore Too rockets 2021-10-14 18:05:39 -07:00
epCode 65bb7877ed Fix enchanted crossbows not taking arrows, and locationsless playing as well as some upgraded firework textures. 2021-10-13 15:09:57 -07:00
epCode 9ae4fc538d Fix wieldview for crossbow 2021-10-13 13:31:26 -07:00
epCode dc8c5dbfcc Revamp Crossbows 2021-10-13 12:26:54 -07:00
epCode f856b4d06c Git Update 2021-10-13 12:00:06 -07:00
epCode cbe5e618a3 Merge pull request 'Add support for MultiShot enchantment' (#12) from Code-Sploit/MineClone2:master into master
Reviewed-on: #12
2021-02-18 01:22:55 +00:00
epCode af9646ec07 Fix sprint activation 2021-02-17 14:31:40 -08:00
epCode 144607bc9c Give the Player running animations 2021-02-17 14:08:21 -08:00
Code-Sploit 63894eb5d6 Make crossbows check for multishot enchantment 2021-02-17 14:29:33 +00:00
Code-Sploit 79e03579bd Add MultiShot enchantment 2021-02-17 14:28:47 +00:00
epCode 377c7c760d Make player anims more MC-like 2021-02-16 17:33:10 -08:00
epCode 0261978f2d Some Crossbow Fixes 2021-02-16 17:32:53 -08:00
epCode 0cb72cdbab Updates 2021-02-16 17:32:41 -08:00
epCode 86f988890d Crossbow fixes and tweaks 2021-02-15 12:37:46 -08:00
epCode 9307e06df5 remove hostile llama 2021-02-14 20:01:41 -08:00
epCode a6b3959790 Add charged creeper 2021-02-14 20:01:04 -08:00
epCode 9147c90b30 Add working crossbows 2021-02-14 20:00:42 -08:00
epCode 964607e5b9 Bring Rp Up-to-date 2021-02-14 19:22:23 -08:00
epCode 3f9bd759b5 Update various 2021-02-10 18:54:33 -08:00
epCode 507e17200c Fix player Bone positioning 2021-02-08 21:55:37 +00:00
epCode bde4719c6b Delete 'mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d' 2021-02-08 21:52:05 +00:00
epCode a61c6b7fae Delete 'mods/ITEMS/mcl_armor/models/mcl_armor_character.blend' 2021-02-08 21:43:14 +00:00
epCode 0a521a9dbe Fixes for Collisionbox and Nametag 2021-02-08 01:23:15 +00:00
epCode a52ae98c84 Merge pull request 'fix for commits' (#8) from MineClone2/MineClone2:master into master
Reviewed-on: #8
2021-02-07 23:12:27 +00:00
Elias Fleckenstein 26037157f8 Merge pull request 'Swimming animations' (#1074) from epCode/MineClone2:master into master
Reviewed-on: MineClone2/MineClone2#1074
2021-02-07 14:05:05 +00:00
epCode 29d43b9709 Fix player head with wrong pitch while swiming 2021-02-06 18:18:19 -08:00
epCode c5169e48a1 Merge branch 'master' of https://git.minetest.land/epCode/MineClone2 2021-02-06 17:50:27 -08:00
epCode dbe009f376 Merge pull request 'master' (#7) from MineClone2/MineClone2:master into master
Reviewed-on: #7
2021-02-07 01:47:20 +00:00
epCode 38f70561c5 Swiming coment 2021-02-06 17:44:30 -08:00
epCode adbfd6b55d Merge branch 'master' of https://git.minetest.land/epCode/MineClone2 2021-02-06 17:40:24 -08:00
epCode df8bdfbc36 Animations for swiming 2021-02-06 17:40:07 -08:00
kay27 84289a3a11 Tiny code cleanup and potentially bugfix after latest mergings 2021-02-07 02:56:00 +04:00
Elias Fleckenstein a42bd72edf Merge pull request 'Visual Sneaking, Minecraft-like breathing anim, Spawn egg textures. Whielditem reposition, and arm pitch control.' (#1071) from epCode/MineClone2:master into master
Reviewed-on: MineClone2/MineClone2#1071
2021-02-06 19:48:04 +00:00
epCode b5353c060f Merge branch 'master' into master 2021-02-06 19:35:13 +00:00
Lizzy Fleckenstein 88ed1aaa87 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-02-06 20:04:09 +01:00
Elias Fleckenstein 50c901c2b7 Merge pull request 'Flame arrows ignite TNT' (#1067) from HimbeerserverDE/MineClone2:master into master
Reviewed-on: MineClone2/MineClone2#1067
2021-02-06 17:07:06 +00:00
HimbeerserverDE fbb5f7464c Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-02-06 17:50:15 +01:00
epCode 282af37555 Add some sneaking commentary 2021-02-05 19:44:41 -08:00
epCode 1868f31673 Merge branch 'master' of https://git.minetest.land/epCode/MineClone2 2021-02-05 16:40:14 -08:00
epCode 729c60cd4b Nametag vanishes when sneaking 2021-02-05 16:39:50 -08:00
epCode 6f8d728035 Merge pull request 'master' (#6) from MineClone2/MineClone2:master into master
Reviewed-on: #6
2021-02-06 00:10:00 +00:00
kay27 696ae8e6fe Merge pull request 'Fix Mobs not taking knockback on the Y-axis' (#1061) from Code-Sploit/MineClone2:master into master
Reviewed-on: MineClone2/MineClone2#1061
2021-02-05 21:41:38 +00:00
kay27 fa3e37c604 A mob does not drop XP unless it dies within 5 s of an attack registered as a player hit, MineClone2/MineClone2#1021 (comment) 2021-02-05 16:34:49 +04:00
Code-Sploit 95b0a27213 Fix Mobs not taking knockback on the Y-axis 2021-02-05 10:36:48 +00:00
epCode 403c174722 Merge branch 'master' of https://git.minetest.land/epCode/MineClone2 2021-02-03 17:14:06 -08:00
epCode 37baf5e69a Fix sneak/R.click bugs. 2021-02-03 17:12:28 -08:00
epCode f37096cb4b Merge branch 'master' of https://git.minetest.land/epCode/MineClone2 2021-02-03 17:05:48 -08:00
epCode cf837247a7 Fix sneak/R.click bugs. 2021-02-03 16:59:58 -08:00
epCode bd98529945 Fix sneak/R.click bugs 2021-02-03 16:29:33 -08:00
kay27 13a9dbed3e Fix MineClone2/MineClone2#1052 (stop searching trees after 10+ attempts) 2021-02-04 03:41:43 +04:00
Lizzy Fleckenstein 18dd3ac9bd Add 'ice' group 2021-02-03 17:08:04 +01:00
kay27 9492f276fc Make mcl_spawn compatible with flat mapgen with superflat MCL2 option (but better to have some trees still) 2021-02-03 16:08:00 +04:00
kay27 e8f8d4cb1e Better fix spawn point search (follow-up 32cf25dc17) 2021-02-03 04:22:02 +04:00
kay27 32cf25dc17 Fix spawn point search 2021-02-03 03:53:47 +04:00
epCode e0ad09900c Merge pull request 'master' (#5) from MineClone2/MineClone2:master into master
Reviewed-on: #5
2021-02-02 22:19:58 +00:00
MysticTempest e716ebd911 Make enderman grief less frequently, enable pseudobiome villages by default, and disable natural village generation in singlenode. 2021-02-01 15:45:22 -06:00
HimbeerserverDE ee6d8451d2 Flame arrows ignite TNT 2021-02-01 08:15:28 +01:00
Lizzy Fleckenstein b5d92f3078 Fix warning in mcl_beds 2021-01-31 14:04:11 +01:00
Lizzy Fleckenstein 9956e267aa Allow for 2 drivers in a boat 2021-01-31 12:54:40 +01:00
Lizzy Fleckenstein 3d8d630a9e Merge branch 'master' of https://git.minetest.land/HimbeerserverDE/MineClone2 2021-01-30 21:56:07 +01:00
Lizzy Fleckenstein 4200dbdaa4 Update to new repo URL 2021-01-30 21:50:54 +01:00
Lizzy Fleckenstein da7dfb1ea4 Update README and CONTRIBUTING to the new maintainership situation 2021-01-30 19:51:55 +01:00
HimbeerserverDE a654db7684 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-30 19:35:32 +01:00
kay27 b0f151147c Fix the trees, Wuzzy/MineClone2#1031 2021-01-30 05:23:34 +04:00
kay27 948265fd6b Fix Wuzzy/MineClone2#1028 - Make tree saplings grow in inactive areas (approx. time calc.) 2021-01-30 04:42:53 +04:00
kay27 30b4b9661c Villages cleanup 2021-01-29 23:03:39 +04:00
Lizzy Fleckenstein b61ae6a61f Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-29 19:43:24 +01:00
MysticTempest 2fe5ac8569 Add experimental, pseudobiome-based village variation. 2021-01-28 23:59:01 -06:00
Lizzy Fleckenstein 65219d34a2 Animated shulkerboxes 2021-01-28 20:53:57 +01:00
HimbeerserverDE 8ae233ba36 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-28 20:16:32 +01:00
HimbeerserverDE 000dd3cbc9 Only burning arrows set objects on fire 2021-01-28 20:16:26 +01:00
kay27 9a668204cb Remove inter-village distance check 2021-01-28 23:12:16 +04:00
Lizzy Fleckenstein e66d66caf9 Fix #399 2021-01-28 19:02:44 +01:00
Lizzy Fleckenstein 4fe944445b Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-28 17:45:04 +01:00
Lizzy Fleckenstein 89ce072621 Sneak to dismount when in boat 2021-01-28 17:44:55 +01:00
kay27 5e65307819 Fix Wuzzy/MineClone2#897 2021-01-28 17:55:33 +04:00
kay27 f20f9f9a88 Log weather changes according to Wuzzy/MineClone2#897 2021-01-28 11:47:51 +04:00
MysticTempest ff38a44454 Give 'mcl_villages' the proper loot table, fix blacksmith shop catching fire/missing chest, add butcher shop, remove chest from large_houses, and remove screenshots. 2021-01-28 01:24:43 -06:00
kay27 ff2cd808d5 Fix Wuzzy/MineClone2#1022 2021-01-28 03:17:11 +04:00
kay27 1f18c2438c Minor weather code clean up, ref. Wuzzy/MineClone2#897 2021-01-28 02:03:49 +04:00
HimbeerserverDE a3ccb54376 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-27 20:13:16 +01:00
HimbeerserverDE 00df587bf7 Add flame enchantment 2021-01-27 20:11:02 +01:00
Lizzy Fleckenstein dbd6ebd4b5 Fix #1014 2021-01-27 19:21:28 +01:00
Lizzy Fleckenstein 85f3fb7ea1 Fix #1005 2021-01-27 16:42:49 +01:00
Lizzy Fleckenstein 248272a128 Fix #1018 2021-01-27 16:01:04 +01:00
Lizzy Fleckenstein 5ede42bbe7 Fix #1020 2021-01-27 15:46:10 +01:00
Lizzy Fleckenstein db3a31c2c4 Simplify chest animations 2021-01-27 15:45:23 +01:00
kay27 7210dfcc1c Make mobs only drop XP orbs when they're killed by hit, attempt to fix Wuzzy/MineClone2#978 2021-01-27 16:12:34 +04:00
MysticTempest 0c23406531 Add mcl_villages; with support for seed-based, and multithreaded village generation by kay27. 2021-01-27 02:56:53 -06:00
MysticTempest 9feee980f8 Add help text for enchanting table. 2021-01-27 01:41:23 -06:00
Lizzy Fleckenstein 97594c89fb Fix #968 2021-01-26 18:51:18 +01:00
Lizzy Fleckenstein e05576b3f3 Don't despawn villagers 2021-01-26 18:40:16 +01:00
Lizzy Fleckenstein e9f9d96eb1 Fix #1012 2021-01-26 17:42:45 +01:00
Lizzy Fleckenstein 953a2f2cd1 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-26 17:26:44 +01:00
Lizzy Fleckenstein 757da9cd7e Add releasing documentation 2021-01-26 17:21:05 +01:00
Elias Åström 1d27a18578 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-26 17:06:20 +01:00
Elias Åström 948438bd1c Add max_blast_resistance to mcl_explosions.explode
If the option is specified, then the explosion will treat all
non-indestructible nodes as having a blast resistance of no more than
the value of the option.
2021-01-26 17:04:22 +01:00
Elias Åström 34274486c7 Add griefing option to mcl_explosions.explode
When set to false explosions will only affect entities and not destroy
nodes.
2021-01-26 17:04:22 +01:00
Elias Åström e3d2284485 Refactor some stuff in mcl_explosions 2021-01-26 17:04:22 +01:00
Elias Åström 4a07b0607f Improve API of mcl_explosions.explode
Replace the 'no_sound' and 'no_particle' options in the 'info' parameter
with 'sound' and 'particles'.  But also has backwards compatability for
the old parameter names.
2021-01-26 17:04:22 +01:00
Elias Åström c907df9669 Tiny code style cleanup in mcl_explosions 2021-01-26 17:04:22 +01:00
Elias Åström 5ecb56452e Fix creeper explosions only doing 1/2 heart damage
The solution was to move the creeper explosions to originate from the
center of the creepers collisionbox and not its entity position.
2021-01-26 17:04:22 +01:00
MysticTempest 41bd803185 Add support for mcimported worlds by clearing out singlenode mapgen, and adding a toggleable fix for converted double_plants. 2021-01-26 17:04:22 +01:00
MysticTempest d571d62863 Fix crash in 'mcl_spawn' in v6,flat,singlenode mapgens; and fix mobs despawning when attacking/following players. 2021-01-26 17:04:22 +01:00
Lizzy Fleckenstein 0dd059d60d Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-26 15:12:12 +01:00
Lizzy Fleckenstein 503686380b Update MISSING_ENGINE_FEATURES.md 2021-01-26 15:12:03 +01:00
Elias Åström 174a3a2968 Fix creeper explosions only doing 1/2 heart damage
The solution was to move the creeper explosions to originate from the
center of the creepers collisionbox and not its entity position.
2021-01-26 14:13:30 +01:00
MysticTempest cbd3a491f6 Add support for mcimported worlds by clearing out singlenode mapgen, and adding a toggleable fix for converted double_plants. 2021-01-25 20:23:38 -06:00
Lizzy Fleckenstein 0022c9902b Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-25 16:33:41 +01:00
MysticTempest c1c5ed4869 Fix crash in 'mcl_spawn' in v6,flat,singlenode mapgens; and fix mobs despawning when attacking/following players. 2021-01-24 17:47:28 -06:00
Lizzy Fleckenstein 9b1b1504fd TextureConverter: Support experience bottles 2021-01-24 20:00:29 +01:00
Lizzy Fleckenstein a514b97880 Make cleric sell experience bottle 2021-01-24 19:55:33 +01:00
Lizzy Fleckenstein 467683a7f9 Add experience bottle 2021-01-24 19:46:39 +01:00
Lizzy Fleckenstein 76bd139f1b Rise mob spawning distance to 24 (Closes #982) 2021-01-24 19:07:56 +01:00
Lizzy Fleckenstein 4a3916236c Make WIP items appear in crafguide (Closes #998) 2021-01-24 19:03:52 +01:00
Lizzy Fleckenstein 9ce8c95f8c Fix bed not dropping when top part is dug 2021-01-24 18:54:17 +01:00
Lizzy Fleckenstein 745b7063a5 Move bed messages to HUD; Fix #1000 2021-01-24 18:40:29 +01:00
Lizzy Fleckenstein fdfcf9ca70 Fix #1001 2021-01-24 16:29:24 +01:00
Lizzy Fleckenstein eb01c8e9f8 Give boats HP (Closes #991) 2021-01-24 16:27:04 +01:00
Lizzy Fleckenstein 73d6533aff Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-23 16:19:50 +01:00
Lizzy Fleckenstein f9a82aab05 Implement curing zombie villagers 2021-01-23 15:40:12 +01:00
kay27 94840ec2ef Fix black chests, Wuzzy/MineClone2#995 2021-01-23 00:43:46 +04:00
Lizzy Fleckenstein b7c3096364 Spawn villager zombies like in Minecraft 2021-01-22 20:31:58 +01:00
Lizzy Fleckenstein 4a4a834bf8 Generate Enchanted golden apples in chests 2021-01-22 19:45:18 +01:00
Lizzy Fleckenstein 291991c745 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-22 19:08:11 +01:00
Lizzy Fleckenstein a92273b930 Gold apples give the player effects; Added Enchanted Golden Apples (Swiftnes & Leaping instead of Absorbtion and Resistance) 2021-01-22 19:08:01 +01:00
kay27 c9294a4d8a Fix Wuzzy/MineClone2#996 Coordinate exploit in signs and chests, sent by @cora 2021-01-22 21:42:37 +04:00
kay27 2e898b3113 Decrease player burn time in Creative mode 2021-01-22 20:03:55 +04:00
MysticTempest 689e6edac2 Make 'mcl_burning' support other texture packs. 2021-01-22 03:07:21 -06:00
kay27 c4dce1df25 Fix already created End portals 2021-01-21 18:35:04 +04:00
kay27 a41e0628e5 Fix Wuzzy/MineClone2#994 Crash in mcl_mobs 2021-01-21 12:36:33 +04:00
Lizzy Fleckenstein b6aabfc853 Fix #992 2021-01-20 16:20:45 +01:00
Lizzy Fleckenstein 0e0628bcc5 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-20 16:14:30 +01:00
Lizzy Fleckenstein 3d7e89811d Fix #990 2021-01-20 16:14:23 +01:00
kay27 1a2c500873 Restore missing 'died formspec' after player exploded being in the bed 2021-01-20 01:46:52 +04:00
Lizzy Fleckenstein 088f2eecae Texture_Converter: Support animated chests 2021-01-18 20:16:37 +01:00
Lizzy Fleckenstein 02305c914d Merge branch 'enchanted_books_creative' 2021-01-18 20:08:37 +01:00
Lizzy Fleckenstein 9cc3b5ccda Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-18 19:55:59 +01:00
Lizzy Fleckenstein 09ab1482b5 Merge branch 'animated_chests' 2021-01-18 19:55:48 +01:00
kay27 81c27363a3 Add limitations to respawn search algorithm to make it work faster 2021-01-17 22:07:02 +04:00
Lizzy Fleckenstein 427ac03a4d Fix #951 2021-01-17 13:21:09 +01:00
Lizzy Fleckenstein bb0e5af6d0 Fix crash when attempting to create grass path with efficiency shovel 2021-01-17 12:39:11 +01:00
Lizzy Fleckenstein 4b61b3b4e5 #986 2021-01-17 12:29:25 +01:00
Lizzy Fleckenstein 6e6f994a43 Make dragon breath use the dragon breath texture 2021-01-17 12:07:49 +01:00
Lizzy Fleckenstein fa9d4402c7 Fix doors dropping duplicate when blown up 2021-01-17 12:00:00 +01:00
Lizzy Fleckenstein b54b6c4c97 Fix #987 2021-01-17 10:41:13 +01:00
Lizzy Fleckenstein c70d33fc8e Texture_Converter: Fix potions 2021-01-17 10:20:27 +01:00
Lizzy Fleckenstein be5a228bad Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-17 10:12:11 +01:00
Lizzy Fleckenstein c024bc43d0 Texture_Converter: Armor support 2021-01-17 10:12:03 +01:00
kay27 5b44eeb611 Teach observer to detect TNT in realtime mode, fix crash in mcl_spawn on restart server in less than 30s in new world 2021-01-17 02:48:36 +04:00
kay27 5400cdba35 Fix blowing up a bed makes it drop twice, Wuzzy/MineClone2#985 2021-01-16 22:50:29 +04:00
kay27 fe33f172d4 Add player-friendly respawn place search algorithm, fix Wuzzy/MineClone2#515 Wuzzy/MineClone2#972 Wuzzy/MineClone2#981 2021-01-16 18:51:30 +04:00
Wuzzy 51b97ca289 Version 0.70.0 2021-01-16 05:32:56 +01:00
Lizzy Fleckenstein 15dd969adf Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-15 17:40:57 +01:00
Lizzy Fleckenstein 50e90e8c23 Fix #983 2021-01-14 20:00:10 +01:00
Elias Fleckenstein b338d36d63 Remove the /burn command 2021-01-12 09:19:18 +00:00
Lizzy Fleckenstein 1f05d8f876 Knockback enchantment working on mobs 2021-01-11 16:38:05 +01:00
Lizzy Fleckenstein 68f5d1c0fb Texture_Converter: Potion bottles support 2021-01-11 15:08:32 +01:00
Lizzy Fleckenstein 41246f61f2 Texture_Conveter: Enchanted book support 2021-01-11 13:59:47 +01:00
Lizzy Fleckenstein c9427e0421 Texture_Conveter: End crystal item support 2021-01-11 13:57:11 +01:00
Lizzy Fleckenstein 95cc6ba532 Texture_Conveter: End crystal support 2021-01-11 13:54:01 +01:00
Lizzy Fleckenstein c4c3fc1c8c Fix Fire Aspect 2021-01-10 14:16:00 +01:00
Lizzy Fleckenstein a9bdb7b509 Fix #969 2021-01-08 14:55:02 +01:00
Lizzy Fleckenstein 20ab04dfc0 Fix #976 2021-01-08 14:43:49 +01:00
Lizzy Fleckenstein 7a1e6246d6 Remove wield_image from all shovels 2021-01-08 14:40:02 +01:00
kay27 eef5f2cc5b Revert 2be8a550dc according to Wuzzy/MineClone2#973 2021-01-08 14:36:50 +01:00
kay27 fd4ce3c688 Scale mcl_farming_pumpkin_face_preview.png 32x64 to 16x32 according to Wuzzy/MineClone2#974 2021-01-08 14:30:11 +01:00
Lizzy Fleckenstein 5ce1fd6821 Rise XP collection distance 2021-01-07 14:42:19 +01:00
Lizzy Fleckenstein 2f1a918667 Fix thorns incompabilities 2021-01-06 19:41:11 +01:00
Lizzy Fleckenstein 9a31252c5d Fix sharpness and bane of arthopods being compatible 2021-01-06 19:04:04 +01:00
Lizzy Fleckenstein 7bcc8c1534 Fix #863 2021-01-06 14:50:49 +01:00
Lizzy Fleckenstein 7d4688b70c Fix enchanted items showing up in craftguide 2021-01-06 14:17:27 +01:00
Lizzy Fleckenstein 2be8a550dc Merge branch 'itemframe' 2021-01-06 14:05:09 +01:00
Lizzy Fleckenstein aee607800e Merge branch 'large_chest_put' 2021-01-06 14:03:54 +01:00
Lizzy Fleckenstein a49e3c9068 Fix #703 2021-01-06 13:39:19 +01:00
Lizzy Fleckenstein b616ce734f Fix mobs taking damage from fire and lava even if they shouldn't 2021-01-06 13:31:51 +01:00
Lizzy Fleckenstein f68a75f184 Fix #750 2021-01-06 13:28:58 +01:00
Lizzy Fleckenstein 3787b95e0f Fix #700 2021-01-06 13:01:27 +01:00
Lizzy Fleckenstein 034174390d Fix #801 2021-01-06 12:48:39 +01:00
Lizzy Fleckenstein 08a8b155d7 Fix #906 and #902 2021-01-06 12:43:09 +01:00
Lizzy Fleckenstein 3a02e90c3a Fix mobs jumping against walls again and again due to a typo 2021-01-06 12:14:20 +01:00
Lizzy Fleckenstein f2c978c892 Fix #885 2021-01-06 12:04:02 +01:00
Lizzy Fleckenstein fd5f3a8df7 Mobs can't jump while already in air 2021-01-06 11:47:50 +01:00
kay27 bdd0123c77 keep mobs from disappearance 2021-01-06 11:25:56 +01:00
Lizzy Fleckenstein 52ed7f668e Small mob shoot raycast improvement 2021-01-06 11:18:18 +01:00
Lizzy Fleckenstein bc15c9c22d Fix #965 2021-01-06 10:36:57 +01:00
kay27 faa944193a try to fix Wuzzy/MineClone2#963 2021-01-05 20:45:56 +01:00
Lizzy Fleckenstein 823ff7e22e Fix #955 2021-01-05 20:36:50 +01:00
Lizzy Fleckenstein 059629c51f Fix wrong mob spawning distance from player 2021-01-05 20:29:10 +01:00
Lizzy Fleckenstein cd1b8e9d2f Fix #962 2021-01-05 20:12:50 +01:00
Lizzy Fleckenstein c405242fa2 Fix #801 2021-01-05 19:52:57 +01:00
Lizzy Fleckenstein 8b92d795d2 Fix #960 2021-01-05 18:05:20 +01:00
Lizzy Fleckenstein 5899c2059f Fix #860 2021-01-05 18:02:41 +01:00
Lizzy Fleckenstein 6f49a3d535 Fix #788 2021-01-05 17:52:27 +01:00
Lizzy Fleckenstein e7721b91a0 Fix #959 2021-01-05 17:35:06 +01:00
Lizzy Fleckenstein 7bdce54048 Give credit for the enchanting sounds (Closes #921) 2021-01-05 17:27:38 +01:00
Lizzy Fleckenstein 8ef14dd81f Fix #872 2021-01-05 17:23:24 +01:00
Lizzy Fleckenstein 96ca23419a Fix #944 2021-01-05 15:40:03 +01:00
Lizzy Fleckenstein 14551edcd2 Remove debugging message from last commit 2021-01-05 15:23:42 +01:00
Lizzy Fleckenstein f253d49a8d Fix #901 2021-01-05 15:19:31 +01:00
Lizzy Fleckenstein d88b548ddb Fix #917 2021-01-05 15:08:18 +01:00
Lizzy Fleckenstein fcc485a8e3 Fix #904 2021-01-05 14:40:54 +01:00
Lizzy Fleckenstein a0ffe92587 Merge branch 'master' into itemframe 2021-01-05 14:27:08 +01:00
Lizzy Fleckenstein 139a4d94d0 Merge branch 'master' into enchanted_books_creative 2021-01-05 14:25:56 +01:00
Lizzy Fleckenstein 90f1fde8c8 Merge branch 'master' into animated_chests 2021-01-05 14:25:20 +01:00
Lizzy Fleckenstein 49c70560a5 Fix #946 2021-01-05 14:13:33 +01:00
Lizzy Fleckenstein 37f256648b Fix enchanting book animation being weird sometimes 2021-01-05 12:40:29 +01:00
Lizzy Fleckenstein ebc2ec9f72 Add missing enchanting sound 2021-01-05 12:37:15 +01:00
kay27 6fcf1cf09f Make catching XP orbs easier 2021-01-05 12:21:01 +01:00
kay27 4d54766590 quick fix of Wuzzy/MineClone2#954 2021-01-05 12:15:43 +01:00
kay27 c2a14e2eae Make glyph particles more close to MC and visible only for players in radius 15 2021-01-05 12:13:36 +01:00
Lizzy Fleckenstein dc5ff37449 Fix #954 2021-01-04 20:44:35 +01:00
Lizzy Fleckenstein b0b23b7532 Call on_rightclick when clicking a node with fishing rod 2021-01-04 20:23:14 +01:00
Lizzy Fleckenstein cfc86bcf3d Fix #952 and other occurences of get_player_velocity 2021-01-04 18:06:31 +01:00
Lizzy Fleckenstein 796c80b2d1 Merge branch 'fixes' into enchanted_books_creative 2021-01-04 17:59:41 +01:00
Lizzy Fleckenstein 0a482cc0cf Merge branch 'fixes' into itemframe 2021-01-04 17:58:54 +01:00
Lizzy Fleckenstein a7c42306a7 Merge branch 'fixes' into animated_chests 2021-01-04 17:58:42 +01:00
Lizzy Fleckenstein aea051fe37 Proper fire aspect damage 2021-01-04 17:53:49 +01:00
Lizzy Fleckenstein 378dca593e Always create chest entities 2021-01-04 17:16:48 +01:00
Lizzy Fleckenstein 17ff0c9be5 No static_save for chest entities 2021-01-04 17:14:51 +01:00
Lizzy Fleckenstein de810cee81 Fix chest migration in general 2021-01-04 17:10:07 +01:00
Lizzy Fleckenstein e26a644df0 Fix ender chest migration 2021-01-04 17:02:36 +01:00
Lizzy Fleckenstein 6d16c2e348 Merge branch 'fixes' into animated_chests 2021-01-04 16:50:03 +01:00
Lizzy Fleckenstein ac54e3caf3 Fix despawning once and for all (hopefully) 2021-01-04 16:40:18 +01:00
Lizzy Fleckenstein a4d7bd03e1 Change itemframe entity drawtype from wielditem to item 2021-01-04 16:19:14 +01:00
Lizzy Fleckenstein 7d1ce8bc07 Merge remote-tracking branch 'origin/master' into enchanted_books_creative 2021-01-04 14:23:39 +01:00
Lizzy Fleckenstein 9dc0d103a1 Merge branch 'fixes' into animated_chests 2021-01-04 14:22:27 +01:00
Lizzy Fleckenstein 507f2d872b Fix #949 2021-01-04 14:21:28 +01:00
Lizzy Fleckenstein 269ebc2718 Fix Silk Touch drop of Top Snow 2021-01-04 13:34:57 +01:00
Lizzy Fleckenstein f86cf37ac9 Fix zombies sometimes just disappearing when dieing to fire 2021-01-04 13:30:30 +01:00
Lizzy Fleckenstein 5939baee52 Enchanted books in creative inventory 2021-01-04 13:02:55 +01:00
Lizzy Fleckenstein cfa6937df4 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into burning_objects 2021-01-04 11:45:06 +01:00
Lizzy Fleckenstein ce4e86549b Enderchest Support 2021-01-04 11:26:07 +01:00
Lizzy Fleckenstein c36dc16527 Fix #948 2021-01-04 10:15:28 +01:00
Lizzy Fleckenstein abdb76c2a0 Fix #942 2021-01-04 10:09:44 +01:00
Lizzy Fleckenstein 41a364b319 Crack texture is now displayed 2021-01-03 20:08:53 +01:00
Lizzy Fleckenstein 0cfb60a826 Fix #941 2021-01-03 19:20:23 +01:00
Lizzy Fleckenstein 84cd8195c6 Fix invalid migration of small chests 2021-01-03 19:05:07 +01:00
Lizzy Fleckenstein 2d9ec679c0 Fix floating chest entity 2021-01-03 18:55:41 +01:00
Lizzy Fleckenstein 978aa38196 Trapped chests support 2021-01-03 18:52:24 +01:00
Lizzy Fleckenstein 5ce8c229db Merge branch 'burning_objects' into animated_chests 2021-01-03 18:25:40 +01:00
Lizzy Fleckenstein 10d6ca4107 Change max_hear_distance of fire sound and tweak fire entity size 2021-01-03 18:22:33 +01:00
Lizzy Fleckenstein ae59f9fd3c Inventory + Screwdriver support 2021-01-03 18:16:12 +01:00
Lizzy Fleckenstein 54f7d76298 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-03 15:34:49 +01:00
Lizzy Fleckenstein 02777b1f65 Fix mcl_craftguide completely 2021-01-03 15:25:06 +01:00
Lizzy Fleckenstein 1fda78667f Properly merge mcl_craftguide 2021-01-03 15:23:29 +01:00
Lizzy Fleckenstein 6b2416b211 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into fixes 2021-01-03 15:17:08 +01:00
Lizzy Fleckenstein 9e97331bdc Fix mobs despawning while close to player 2021-01-03 15:10:50 +01:00
Lizzy Fleckenstein 0fe1707c2f Remove spaces 2021-01-03 14:32:31 +01:00
Lizzy Fleckenstein 6cc029a6e4 Fix #931 2021-01-03 14:26:05 +01:00
Wuzzy 4c2f3f2b7c Fix possible crash in mcl_craftguide 2021-01-03 14:22:19 +01:00
Wuzzy 3390370441 Update README 2021-01-03 14:21:50 +01:00
Lizzy Fleckenstein ea938237d5 Animated Chests 2021-01-03 14:21:35 +01:00
kay27 30379c823c Clean up some spaces in code after merging https://git.minetest.land/EliasFleckenstein03/MineClone2 2021-01-03 00:42:07 +04:00
Lizzy Fleckenstein c2521885ff Remove extinguish sound 2021-01-02 14:03:50 +01:00
Lizzy Fleckenstein 7d45055a59 Remove minetest.env in mcl_mobs API 2021-01-02 12:45:23 +01:00
Lizzy Fleckenstein 081ae7fbff Make undead mobs burn in sunlight instead of dealing damage directly 2021-01-02 12:43:50 +01:00
Lizzy Fleckenstein 8ba8f62527 Document fire_resistant and fire_damage_resistant 2021-01-02 12:34:02 +01:00
Lizzy Fleckenstein 7d805ff789 Fix duplicate bookshelf positions 2021-01-02 12:28:38 +01:00
Lizzy Fleckenstein 64e510a730 Better bookshelf counting 2021-01-02 12:21:35 +01:00
Lizzy Fleckenstein ab079d0c9b Fix missing enchantability of golden shovel 2021-01-02 12:11:16 +01:00
Lizzy Fleckenstein 939a73dd77 Remove Licenses from mcl_burning and mcl_enchanting 2021-01-02 11:18:18 +01:00
Lizzy Fleckenstein 883056bbc2 Fix #16 2021-01-02 11:15:32 +01:00
Lizzy Fleckenstein 84708c3870 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2021-01-02 10:58:02 +01:00
Lizzy Fleckenstein 2bc5a281f5 Player damage texture modifier 2021-01-02 10:57:33 +01:00
Lizzy Fleckenstein fbd4a3a516 Fix burning sound keeping playing 2021-01-02 10:56:40 +01:00
kay27 d42ee00290 Fix piston owner metadata storage 2021-01-02 02:54:41 +04:00
Lizzy Fleckenstein 212e895c1a Fire Aspect for Mobs 2021-01-01 19:59:34 +01:00
Lizzy Fleckenstein 2932837951 Fix mobs always dropping cooked loot 2021-01-01 19:52:34 +01:00
Lizzy Fleckenstein 92bf864807 Fire Aspect 2021-01-01 19:51:31 +01:00
Lizzy Fleckenstein 071ba77bb0 mcl_burning fully working 2021-01-01 19:25:47 +01:00
Lizzy Fleckenstein a6eed5c5b3 Rework system 2020-12-29 22:08:38 +01:00
Wuzzy e8573189d8 Fix XP bar overflow after enchant 2020-12-28 15:32:24 +01:00
Wuzzy a4b2172ac5 Version 0.69.1 2020-12-27 16:59:34 +01:00
kay27 5385a3f202 Fix piston protection check 2020-12-27 17:11:22 +04:00
Lizzy Fleckenstein 758a3470f3 Fire resistance potion working 2020-12-24 17:55:33 +01:00
Lizzy Fleckenstein 7545e29f58 Burning objects 2020-12-24 17:48:40 +01:00
Wuzzy c85f2f6064 Version 0.69.0 2020-12-24 04:05:07 +01:00
Lizzy Fleckenstein b017fd7405 Looting actually works now 2020-12-23 19:01:49 +01:00
Lizzy Fleckenstein da7240d6c1 looting 2020-12-23 17:41:42 +01:00
Lizzy Fleckenstein a7ff5be28b Luck of the Sea 2020-12-23 15:18:20 +01:00
MysticTempest 38f89fc963 Fix concrete powder mechanics. 2020-12-23 06:23:55 -06:00
Lizzy Fleckenstein 8f62a3fe0c Enchanted book loot in desert temple 2020-12-23 12:25:18 +01:00
MysticTempest b56ae38939 Make lava/fire wait 2 seconds before destroying items to allow chance for pickup, fix dogs following when sitting, and add some rotation so mobs don't idle at cliffs. 2020-12-22 08:29:24 -06:00
Lizzy Fleckenstein 6ba3fc869c Make villagers sell enchanted stuff 2020-12-22 12:00:04 +01:00
Lizzy Fleckenstein 3161668d26 Color tweaks 2020-12-22 10:42:22 +01:00
Lizzy Fleckenstein e152e346ea Improve XP bar position 2020-12-21 18:27:58 +01:00
Lizzy Fleckenstein 213f62ac06 Fix translations 2020-12-21 18:00:35 +01:00
Lizzy Fleckenstein ef9a54872e Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-12-21 17:58:39 +01:00
Lizzy Fleckenstein 5fe64ff6f1 Better XP bar 2020-12-21 17:02:39 +01:00
Lizzy Fleckenstein a4d9d22bb0 Mending 2020-12-21 15:12:24 +01:00
Lizzy Fleckenstein fdbfd4c654 Mineshaft Loot 2020-12-21 13:57:09 +01:00
Wuzzy b0dc0ecc9c Fix possible nil crashes in mcl_jukebox 2020-12-21 13:13:01 +01:00
epCode f62a003163 More Minecraft-like breathing animation 2020-12-20 16:20:04 -08:00
epCode a228899fc9 Update mcl_player character model 2020-12-20 15:52:26 -08:00
epCode 2b2e0914d4 Added arm pitch control 2020-12-20 14:42:45 -08:00
epCode c5412dd2a7 Added arm control bone 2020-12-20 14:42:21 -08:00
epCode 12564b573b Fine tune player sneaking animations 2020-12-20 14:12:33 -08:00
epCode 76e7b8f637 Player animation tweaks 2020-12-20 14:12:03 -08:00
Lizzy Fleckenstein d820c35937 Fishing & Mineshaft loot 2020-12-20 17:33:24 +01:00
Lizzy Fleckenstein b91b587876 Fix Lure 2020-12-20 16:32:04 +01:00
Wuzzy fd53198c9a No enchant for shears 2020-12-19 16:29:55 +01:00
Wuzzy 39a0fdd24c No enchant 4 flint&steel,pumpkin,head,screwdriver 2020-12-19 16:26:12 +01:00
Wuzzy 821af93675 Translate mcl_experience,mcl_enchanting to de 2020-12-19 16:07:34 +01:00
Wuzzy e22b766ffa Remove enchanted compass (caused a crash) 2020-12-19 15:32:32 +01:00
Lizzy Fleckenstein 6eeeb83c0d Let enderdragon drop Xp 2020-12-19 15:00:15 +01:00
Lizzy Fleckenstein 4f18f77db0 Drop xp for empty furnaces too 2020-12-19 13:02:13 +01:00
Lizzy Fleckenstein 753be59d95 Fixed crash 2020-12-19 11:53:59 +01:00
Wuzzy 1f124476f2 Remove NC enchanting sound 2020-12-19 11:45:41 +01:00
epCode 0d53c946ce Merge pull request 'wielditem' (#4) from wielditem into master
Reviewed-on: #4
2020-12-19 01:04:02 +00:00
epCode eee88adcd1 Merge branch 'wielditem' of https://git.minetest.land/epCode/MineClone2 into wielditem 2020-12-18 16:44:32 -08:00
epCode 2e2b22dc15 Player properties for sneaking 2020-12-18 16:43:42 -08:00
epCode f6ce027441 Merge pull request 'wielditem' (#3) from wielditem into master
Reviewed-on: #3
2020-12-19 00:39:21 +00:00
epCode 39dfc72ac5 Utilized the sneaking animations 2020-12-18 16:29:21 -08:00
epCode acda2ba9bf Added sneaking animations 2020-12-18 16:28:28 -08:00
epCode fec3085593 Added sneak animation entries 2020-12-18 16:27:37 -08:00
Lizzy Fleckenstein 1f0fc01d20 Store XP in furnaces instead of immediately dropping it 2020-12-18 19:03:08 +01:00
Lizzy Fleckenstein 977489de04 Fixed efficiency drops 2020-12-18 17:33:02 +01:00
Lizzy Fleckenstein 66eb5c35da Fix enchanted book 2020-12-18 15:57:52 +01:00
epCode 771964863b Merge pull request 'master' (#2) from Wuzzy/MineClone2:master into wielditem
Reviewed-on: #2
2020-12-18 03:23:52 +00:00
epCode d893c07edc Merge pull request 'master' (#1) from Wuzzy/MineClone2:master into master
Reviewed-on: #1
2020-12-17 23:25:02 +00:00
MysticTempest cb3fa6cd09 Fix magma cubes and zombies not taking damage from hands; and adjust magma cube armors to their proper values. 2020-12-17 16:07:20 -06:00
epCode 44c757ba6e Spawn icons to spawn egg texures 2020-12-17 09:59:34 -08:00
Lizzy Fleckenstein 0477e729f5 Fixed crash 2020-12-17 18:58:07 +01:00
Lizzy Fleckenstein 19726241c3 Fixed lapis slot 2020-12-17 18:53:44 +01:00
MysticTempest fb51ab05ea Enable basic mob despawning. 2020-12-17 09:22:34 -06:00
Lizzy Fleckenstein 6c3588bad8 Rework inventory 2020-12-17 13:29:21 +01:00
Lizzy Fleckenstein f1a4c493c8 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into enchanting 2020-12-17 11:23:59 +01:00
Lizzy Fleckenstein 28239ec0fb Remove enchanting particles on collision 2020-12-17 11:22:00 +01:00
epCode ef8d7b1e6a Added bone control for wielditem 2020-12-16 10:56:05 -08:00
epCode 20cc845940 Transforms wielditem relative to held item 2020-12-16 10:55:56 -08:00
kay27 8eed6eaf4e Slightly optimize fire ignition by lava and make it more MC-like 2020-12-15 00:27:20 +04:00
Wuzzy f6f2037e6a Fix XP bar overflow if trying to go over XP limit 2020-12-14 20:04:52 +01:00
Wuzzy e6d99b8b18 Respawn enchantbook ent when rightclick table 2020-12-14 19:15:40 +01:00
Wuzzy 73cb6b7a22 Don't save book entity statically to save space 2020-12-14 19:08:57 +01:00
Wuzzy 4be2f2f76d Fix more book entity spawn/despawn bugs 2020-12-14 18:53:34 +01:00
Wuzzy e154919b34 Remove book ent. after destructing enchant table 2020-12-14 18:24:24 +01:00
Wuzzy 7d8c33c647 Some minor cleanup in mcl_enchanting 2020-12-14 14:27:20 +01:00
Wuzzy 9028902a87 Remove mcl_experience setting 2020-12-14 14:16:09 +01:00
Wuzzy 70b078cdaf Move mcl_enchanting to ITEMS 2020-12-14 14:11:59 +01:00
Wuzzy 5a7fc3774f Make mcl_enchantments translatable 2020-12-14 14:08:55 +01:00
kay27 e7aa873968 Fix EliasFleckenstein03/MineClone2#3 2020-12-13 03:09:32 +04:00
kay27 5da02bb8cc Merge https://git.minetest.land/EliasFleckenstein03/MineClone2 2020-12-13 03:00:04 +04:00
Wuzzy 0cbbe451d4 Add terrifying enderman noises 2020-12-10 17:52:14 +01:00
Wuzzy 1ca89f699a Add enderman teleport sounds 2020-12-10 16:35:48 +01:00
Wuzzy d699459bac Fix carrot param2 reset to 0 when ate by rabbit 2020-12-09 22:10:42 +01:00
Wuzzy d17c53cb0c Fix mob spawn height for real 2020-12-08 22:42:01 +01:00
Wuzzy 9324c43d8d Reduce grass sound volume 2020-12-08 16:56:27 +01:00
Wuzzy 63e8b8cb63 New bow+arrow sounds 2020-12-08 16:07:49 +01:00
Wuzzy 6532148f2f Add rabbit sounds 2020-12-08 14:52:38 +01:00
Wuzzy 8e65876fdf Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-12-08 01:45:38 +01:00
Wuzzy 7abffc5df9 Fix mobs spawning 1.5 nodes above the ground 2020-12-08 01:44:45 +01:00
kay27 a7c4d4ebd9 Fix obserber watch z coordinate in realtime mode 2020-12-08 00:57:15 +04:00
Wuzzy ac782bac90 Remove unused mesecons_lever.ogg 2020-12-07 05:10:13 +01:00
Wuzzy 8dae3e3460 New button and lever sounds 2020-12-07 04:59:10 +01:00
Wuzzy 9fd27db688 Add new squid death/hurt sounds 2020-12-07 03:01:04 +01:00
Wuzzy 938f62c7c1 Add zombiepig sounds 2020-12-07 01:22:28 +01:00
Wuzzy 9b9ee66b00 Enderman will take nodes only below air 2020-12-07 00:49:46 +01:00
Wuzzy 42155c6bdc Reduce snowman sound volume 2020-12-07 00:06:20 +01:00
Wuzzy 5bd3ebda17 Add throwing sound 2020-12-07 00:02:32 +01:00
Wuzzy e49e75ece2 Add snowman sounds 2020-12-06 23:32:54 +01:00
Wuzzy 1ab90c58a6 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-12-06 21:15:39 +01:00
Wuzzy 91071e9bc2 Add endermite sounds 2020-12-06 21:15:05 +01:00
kay27 827d7ec538 Fix attempt to index local 'pos' at ITEMS/mcl_portals/portal_nether.lua:728 2020-12-06 22:45:44 +04:00
Wuzzy 839c22dcfb Change XP drop amount for each mob 2020-12-06 15:46:42 +01:00
Wuzzy e8cb8a789e Add spider sounds 2020-12-06 13:31:14 +01:00
Wuzzy 92785f7411 Add polar bear sounds 2020-12-06 03:24:32 +01:00
Wuzzy b163d17a53 Add shears cut sound 2020-12-06 01:21:02 +01:00
Wuzzy c2fe18def7 Add bone eating sound for wolf 2020-12-06 01:09:55 +01:00
Wuzzy 29d46a5949 Fix wolf eat sound 2020-12-06 00:50:54 +01:00
Wuzzy 52681658ef Add epic end portal open sound 2020-12-06 00:27:10 +01:00
Wuzzy e894775943 Tweak zombie/skeleton horse sounds 2020-12-05 23:55:30 +01:00
Wuzzy 9d31ddb30d Baby animals don't drop XP 2020-12-05 23:42:33 +01:00
Wuzzy b70e58ab05 Add animal eat sound 2020-12-05 23:37:12 +01:00
Wuzzy da7214bafa Wolf: Bark when tamed, show icon when change order 2020-12-05 22:57:46 +01:00
Wuzzy 376e1c32c5 Add wolf sounds 2020-12-05 22:36:59 +01:00
Wuzzy 22a0b107ba Add flop sound when mob flops on ground 2020-12-05 21:33:37 +01:00
Wuzzy c7084cb79a Add guardian sounds 2020-12-05 21:22:59 +01:00
Wuzzy a764298923 Add Wither spawn sound 2020-12-05 20:53:21 +01:00
Wuzzy bccd91e08f Change mule sounds (=higher pitched donkey sounds) 2020-12-05 19:48:51 +01:00
Wuzzy 99b4ba65c2 Add milking sound for cow and mooshrom 2020-12-05 19:17:15 +01:00
Wuzzy 48582e10d2 Add bat hurt and death sounds 2020-12-05 18:50:43 +01:00
Wuzzy 73744b4fc8 Add donkey sounds 2020-12-05 18:29:35 +01:00
Wuzzy eee892d78e Make parrots spawn in jungles 2020-12-05 17:56:56 +01:00
Wuzzy 389135f87f Add parrot sounds 2020-12-05 17:14:56 +01:00
Wuzzy 1d0ecd5708 New chicken sounds 2020-12-05 16:44:01 +01:00
Wuzzy 8b09cccfd4 Disable footstep sound of flying/swimming mobs 2020-12-05 14:48:58 +01:00
Wuzzy 312bae6a17 Add parrots back into Creative inventory 2020-12-05 14:45:10 +01:00
Wuzzy c0ef6e3d5a Add instant_death for mobs 2020-12-05 14:42:03 +01:00
Wuzzy e23bdca570 Reset mob velocity when surviving flop 2020-12-05 14:20:58 +01:00
Wuzzy c48371e859 Mobs can't runaway while in flop state 2020-12-05 14:16:07 +01:00
Wuzzy a9b59816c4 Implement very basic flopping 2020-12-05 14:14:16 +01:00
Wuzzy cb08062926 Fix some mob-related death bugs 2020-12-05 13:51:29 +01:00
Wuzzy 3a28081683 mcl_mobs: Shorten math.pi 2020-12-05 13:05:12 +01:00
Wuzzy 21310aad59 Fix more death animation bugs 2020-12-05 12:59:12 +01:00
Wuzzy 57e24fc705 Disable object collision of dead mobs 2020-12-05 05:20:43 +01:00
Wuzzy b6c6602d13 New mob death particle and sound 2020-12-05 05:11:53 +01:00
Wuzzy ed3afc6e49 Redo the death effect 2020-12-05 04:33:23 +01:00
Wuzzy 411e180477 Use same death_speed for all mobs 2020-12-05 03:52:08 +01:00
Wuzzy ab7cfa1e43 Improve flight behavior of bat/parrot a little 2020-12-05 03:35:08 +01:00
Wuzzy 9b519cb665 Document mob states 2020-12-05 02:17:39 +01:00
Wuzzy 1362730dbf Mobs don't follow food in hand in love mode 2020-12-05 02:07:43 +01:00
Wuzzy 0d7e957694 Fix player eating item when pointing a mob 2020-12-05 01:56:19 +01:00
Wuzzy 855fd6b279 Drop XP when breeding 2020-12-05 01:49:15 +01:00
Wuzzy a56df1e533 Add mobs debug mode 2020-12-05 01:38:10 +01:00
Wuzzy 7913e72e07 Tweak timing of horny timer and child grow time 2020-12-05 01:26:30 +01:00
Wuzzy 6f9f7a2cb9 Disable XP by default 2020-12-04 18:46:04 +01:00
kay27 945260fa29 quick fix of attempt to index local 'node' (nil value) at mods/ENTITIES/mcl_mobs/api.lua:3392 2020-12-03 23:48:26 +04:00
MysticTempest 09ccfc9802 Copy mcl_item_entity's item flowing code to allow mobs to be pushed by flowing_water, add TenPlus1's mob shoving code, and fix mob swimming breaking recently. 2020-12-03 10:37:44 -06:00
Wuzzy 356977531e Remove all traces of all_pull_sticky 2020-12-03 14:21:25 +01:00
Wuzzy 8dddfe17db Fix kelp dropping always 1 item only 2020-12-03 14:19:37 +01:00
Wuzzy 257d7803a4 Can place kelp also in downwards-flowing water 2020-12-03 14:01:27 +01:00
Wuzzy 51fea93905 Fix all_pull_sticky for real 2020-12-03 13:16:12 +01:00
Wuzzy 30b915b5c2 Fix lightning being heard globally 2020-12-03 13:03:27 +01:00
Wuzzy 2638d91785 Fix arrow hit being heard globally 2020-12-03 12:59:57 +01:00
Wuzzy 7e8c3aebd5 mesecons_mvps: Fix missing all_pull_sticky arg 2020-12-03 12:52:02 +01:00
Wuzzy d60a0a0949 Fix ice melt not cause surrounding nodes to update 2020-12-03 12:36:58 +01:00
kay27 06c97be4a2 Fix Wuzzy/MineClone2#880 2020-12-01 20:10:37 +04:00
kay27 e0734952ce quick fix 'not def and def.walkable' 2020-11-28 17:56:37 +04:00
kay27 2958d96967 Fix Russian translation 2020-11-26 23:34:56 +04:00
Wuzzy 439ed00a20 Add utf-8 mode to translation checker script 2020-11-26 13:35:10 +01:00
Wuzzy c40e97aa2e Fix wrong locale template for mcl_craftguide 2020-11-26 13:32:07 +01:00
Wuzzy c2a8a5c74b Fix typos in check_translate_files.py, make language argument required 2020-11-26 13:27:44 +01:00
Lizzy Fleckenstein ed738da016 Added Enchanting Table 2020-11-25 12:47:27 +01:00
Laurent Rocher af26f18bd6 Complete French Translation 2020-11-18 23:06:47 +01:00
Laurent Rocher 9010cf514d Fix some template.txt files (missing final = of some entries) 2020-11-18 23:05:07 +01:00
Laurent Rocher 7f12c246b5 Python script for check translation files.
It's compare locale\template.txt with translate file (.tr) for a language.
2020-11-18 23:01:56 +01:00
kay27 2b1d21a5b5 Merge branch 'kay27_mechanics' as a squash 2020-11-14 01:59:03 +04:00
Lizzy Fleckenstein a3cf6b0e5d Blast Protection; Fire Protection; Projectile Protection; Feather Falling; Thorns 2020-11-13 12:21:36 +01:00
Lizzy Fleckenstein b53ae0df19 Fix armor runtime error 2020-11-13 09:44:42 +01:00
Wuzzy bd2d0f717a Sugarcane: No place inside liquid 2020-11-12 21:12:25 +01:00
Wuzzy 9365493696 Fix fire resistance bad protect against magmablock 2020-11-12 16:43:12 +01:00
Wuzzy 124274053d Effect: Bigger init timer 2020-11-12 16:28:52 +01:00
Wuzzy c3861bad85 Fix effect icons not initing correctly after join 2020-11-12 16:25:17 +01:00
Wuzzy c5a27ee47a Add status effect icons 2020-11-12 15:46:57 +01:00
Wuzzy 027b240cac Add object crosshair 2020-11-12 13:51:37 +01:00
Wuzzy 51085fd6b8 Enlarge sleep message area 2020-11-12 13:21:26 +01:00
Wuzzy 41a1a3167d Fix wielded item text overlapping with HUD 2020-11-12 12:30:00 +01:00
Wuzzy 271cdbcf03 Fix untranslated nether lava death msgs 2020-11-12 12:23:38 +01:00
Wuzzy d952c79cb7 Slower nether portal anim 2020-11-12 12:01:16 +01:00
Wuzzy 41af1eddba Reset pointing range limit for bow 2020-11-12 11:47:42 +01:00
Wuzzy 8512b7c2e0 Fix swords being too big in itemframe 2020-11-12 11:14:37 +01:00
Wuzzy daff07269a Itemframes: Change dummy texture to blank.png 2020-11-12 10:40:14 +01:00
Wuzzy 132db02011 Sugarcane less strict w/ water check on place 2020-11-11 21:00:37 +01:00
Lizzy Fleckenstein b9e5a991e2 Protection 2020-11-10 13:58:39 +01:00
kay27 47c834a809 Fix XP inditaction when the player dies 2020-11-10 11:25:35 +04:00
Lizzy Fleckenstein 3d7bb69e81 Bane of Arthropods; Smite; Lure 2020-11-09 18:59:08 +01:00
Lizzy Fleckenstein 479dfd6c0d Soul Speed 2020-11-09 10:50:27 +01:00
Wuzzy c7a4f7cbfb Fix brewstand not showing up in craftguide 2020-11-07 01:11:42 +01:00
Lizzy Fleckenstein 494ffb41d3 Punch 2020-11-06 15:05:31 +01:00
Lizzy Fleckenstein 86b2cd70f9 Fortune 2020-11-06 13:46:52 +01:00
Lizzy Fleckenstein 4d37e309e7 FrostWalker 2020-11-05 16:05:42 +01:00
Lizzy Fleckenstein bbc6db489e Power 2020-11-05 15:25:44 +01:00
Lizzy Fleckenstein cdafb1a07e Knockback 2020-11-04 12:00:42 +01:00
Lizzy Fleckenstein 2b55dac7d2 Fixed Curse of Binding bypass in rightclick handler 2020-11-04 11:29:44 +01:00
Lizzy Fleckenstein 7c28bf8507 Silk Touch 2020-11-02 19:09:23 +01:00
Lizzy Fleckenstein 8a406ad968 Sharpness 2020-11-02 17:58:13 +01:00
Lizzy Fleckenstein b89ffb12f2 Unbreaking for fishing rods 2020-11-02 17:38:51 +01:00
Lizzy Fleckenstein 22083a0ff5 Armor textures support 2020-11-02 17:22:03 +01:00
Lizzy Fleckenstein afa11c0723 Unbreaking for armor 2020-11-02 15:33:05 +01:00
Lizzy Fleckenstein a516eccd6d Unbreaking for Bows 2020-11-02 15:09:11 +01:00
Lizzy Fleckenstein 04d8d999e2 Efficiency & Unbreaking 2020-11-02 13:38:17 +01:00
Lizzy Fleckenstein e09ecb5431 Enchanted Books; Fishing Rod Support; Curse of Binding 2020-11-01 17:24:57 +01:00
Lizzy Fleckenstein 3791f8983e Combine tools in anvil 2020-11-01 15:15:44 +01:00
Lizzy Fleckenstein 3fd1963da9 Compass support 2020-11-01 14:23:43 +01:00
Lizzy Fleckenstein 26f3d821a4 Proper anvil naming support 2020-11-01 13:44:05 +01:00
Lizzy Fleckenstein 76303ae194 Working Infinity Enchantment 2020-10-27 20:02:46 +01:00
Lizzy Fleckenstein a76fb8dd57 Added tt support, made enchanted bows function properly 2020-10-27 19:53:49 +01:00
Lizzy Fleckenstein 1cef707c6c /enchant working 2020-10-27 18:19:49 +01:00
Lizzy Fleckenstein 64e62486e2 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-10-27 16:37:40 +01:00
Lizzy Fleckenstein 8ef39f405f Merge branch 'enchanting' of https://git.minetest.land/Wuzzy/MineClone2 2020-10-27 16:37:33 +01:00
Lizzy Fleckenstein 79b624bc5c First Steps 2020-10-27 16:37:25 +01:00
kay27 38ad237d92 Fix multithreaded addition of XP 2020-10-26 10:24:38 +04:00
kay27 9f98117328 Fix XP and Nether ashes 2020-10-26 01:06:35 +04:00
kay27 1965696829 Merge kay27_textures branch: more recongizable obsidian texture; better NP texture; Nether particles 2020-10-24 21:49:11 +04:00
kay27 c4f038ab77 Final (hopefully) megre of XP to master, sorry for all possible conflicts 2020-10-24 13:48:39 +04:00
Wuzzy 730e5f6998 Some mcl_experience cleanup 2020-10-24 11:42:24 +02:00
Wuzzy a4c2211d87 Merge branch 'enchanting' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-10-24 11:38:16 +02:00
kay27 30d9e54803 Implement leftovers of Wuzzy/MineClone2#841 (comment) 2020-10-24 02:46:45 +04:00
Wuzzy 529e3be802 Credit kay27 for XP 2020-10-23 23:54:27 +02:00
Wuzzy 5374376e24 Don't play XP sound for negative or 0 XP 2020-10-23 23:35:46 +02:00
Wuzzy 3236dc0d8e Simplify XP bar 2020-10-23 23:30:40 +02:00
Wuzzy fe1c8ca758 Hard-cap XP at 2^31-1 2020-10-23 23:16:46 +02:00
Wuzzy 6706104c3a Remove enchantment table 2020-10-23 23:00:54 +02:00
Wuzzy 53dbd4e2c2 Clean up /xp syntax help 2020-10-23 22:58:13 +02:00
Wuzzy 3fde86eff6 Experience: Clean up HUD elements 2020-10-23 22:50:53 +02:00
Wuzzy 280f284867 Merge branch 'enchanting' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-10-23 22:32:35 +02:00
kay27 290893355b Implement some of Wuzzy/MineClone2#841 (comment) 2020-10-24 00:18:53 +04:00
Wuzzy 4ad1adb850 Add 2mac to credits 2020-10-23 22:13:55 +02:00
Wuzzy 6b30553707 Merge branch 'cart-acceleration' of https://git.minetest.land/2mac/MineClone2 into master 2020-10-23 22:12:40 +02:00
Wuzzy d2518c91e8 Tweak German End crystal translation 2020-10-23 22:01:59 +02:00
Wuzzy 4c39224e6f Merge https://git.minetest.land/EliasFleckenstein03/MineClone2 into master 2020-10-23 21:53:42 +02:00
Wuzzy a05938db5d Version 0.68.0 2020-10-20 19:42:49 +02:00
kay27 dbe631409c Update mcl_portals_ru.tr 2020-10-19 16:55:05 +04:00
kay27 a127136c60 Add Enchanting from Crafter-minetest by Oil_boi 2020-10-19 16:38:21 +04:00
kay27 4c2e28836c Fix generation of strongholds 2020-10-15 00:22:48 +04:00
kay27 abef71f317 Fix Wuzzy/MineClone2#840 2020-10-14 03:19:00 +04:00
Lizzy Fleckenstein 299099116b Changed drop chance 2020-10-12 11:07:11 +02:00
kay27 f0afebea38 Remove double vector addition for piston pull/push - fix on_placenode() coordinates 2020-10-09 02:09:00 +04:00
kay27 d1807b5844 Remove double on_placenode() for push/pull, see https://git.minetest.land/Wuzzy/MineClone2/src/branch/master/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua#L371 2020-10-08 21:51:07 +04:00
kay27 a78c613322 Fix slimeblock/piston behavior, https://github.com/kay27/MineClone2/issues/4 2020-10-07 23:28:21 +04:00
Wuzzy 5f820c6bf9 Update helptext of obsidian 2020-09-30 17:31:19 +02:00
Wuzzy b0ee0a475b Remove "Loading terrain" msg (too spammy) 2020-09-30 17:27:34 +02:00
Wuzzy 81b33d7df3 Shrink Nether portal texture to 16px 2020-09-30 17:25:12 +02:00
Wuzzy 3bed1c5bf8 Fix accidental global in mcl_portals 2020-09-30 17:10:06 +02:00
kay27 c01c53af49 Prevent opening double chests with solid block(s) on the top 2020-09-30 16:42:52 +04:00
kay27 3cd30a559e sl4v & Nicu: Don't open chests if there is a full block above them, for 1-node normal & trapped chests 2020-09-30 00:32:28 +04:00
kay27 a511152cdf Fix glass bottles remained empty on take water from cauldrons, https://github.com/kay27/MineClone2/issues/1 2020-09-27 22:56:39 +04:00
kay27 339f7c6359 Add calculation of mcl_vars.mapgen_edge_min/max in mcl_init and use them for Nether portal fast travelling 2020-09-26 02:17:49 +04:00
kay27 4eb42c3a9a Merge bzoss_player feature branch 2020-09-25 00:39:51 +04:00
kay27 446b0e6602 Merge updated Nether portals, Wuzzy/MineClone2#804 2020-09-21 22:21:46 +04:00
kay27 8df2aebd31 Add moveresult variable passing to on_step() of mob entity, Wuzzy/MineClone2#837 2020-09-21 11:30:29 +04:00
kay27 15cb94b9b3 Close minor issues with fishing rod timing and permanent_flame alias, Wuzzy/MineClone2#834 & Wuzzy/MineClone2#836 2020-09-20 03:38:31 +04:00
kay27 7678bf9b9f Fix item duplication by brewing stand, by disabling its falling and pushing/pulling, see Wuzzy/MineClone2#831 2020-09-19 11:42:09 +04:00
kay27 fa97aca76a Simplify respawn search algorithm, Wuzzy/MineClone2#833 2020-09-10 21:25:02 +04:00
Wuzzy b47ff2b9be Use pure-API version of tt mod 2020-09-10 15:41:36 +02:00
kay27 daede2a183 Improve around-the-bed-respawn place search algorithm: square spiral up to 7 x/z nodes, thanks anon5, Wuzzy/MineClone2#785 2020-09-09 14:35:44 +04:00
kay27 7bbb7438ae Fix bed checks, see Wuzzy/MineClone2#785 2020-09-08 18:15:57 +04:00
kay27 a2281f384b Add blast resistance for stairs and slabs 2020-09-08 15:06:52 +04:00
kay27 28f19fdbb4 Fix potion names, Wuzzy/MineClone2#829 2020-09-08 07:21:29 +04:00
kay27 f2d68d909e Add some growth for unloaded farming plants 2020-09-05 21:49:12 +04:00
kay27 766c76831d Restore furnaces work when time_speed set to 0 (but for emegred areas only, as it was in 0.66.2) 2020-08-31 11:19:00 +04:00
Wuzzy 9d101ce923 Version 0.67.2 2020-08-29 11:11:40 +02:00
Wuzzy e361b35724 Fix crash delete item entity with empty itemstring 2020-08-29 10:57:33 +02:00
Wuzzy 09ee912096 Fix crash when mob dies after poison/regen 2020-08-29 10:53:44 +02:00
Wuzzy ae4ede757a Version 0.67.1 2020-08-26 12:58:22 +02:00
MysticTempest 2f6afe34ba Fix crash when night_vision tries to apply to a mob. 2020-08-26 00:46:07 -05:00
Wuzzy 8453dac1db Fix MISSING_ENGINE_FEATURES.md typo 2020-08-24 09:35:11 +02:00
Wuzzy e5d6e90913 Mark mcl_node_particles as an experimental setting 2020-08-23 12:07:35 +02:00
Wuzzy 87ffe2e8f5 Set default node particle level to "none" 2020-08-23 12:05:08 +02:00
Wuzzy 4fb0ead10e Make all brewing stand versions use metal sound 2020-08-22 12:12:31 +02:00
Wuzzy 5787b43117 Version 0.67.0 2020-08-22 11:28:36 +02:00
Wuzzy b726dd7689 Credit kay27 for coding work 2020-08-22 11:26:45 +02:00
Wuzzy 3a57a5800b Smoother lingering potion particles in 1st second 2020-08-22 11:18:45 +02:00
kay27 82c3142913 fix a typo in mcl_potions.ru.tr 2020-08-22 05:13:17 +04:00
kay27 81cf500611 fix furnace flame particles 2020-08-22 05:05:55 +04:00
Wuzzy 92c01628a9 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-08-22 00:31:18 +02:00
kay27 a672d901f8 Translate new line in mcl_potions.ru.tr 2020-08-21 22:22:55 +04:00
kay27 e4ca1beacb prevent furnaces flashes on fuel load more correctly 2020-08-21 22:19:23 +04:00
kay27 a728974d8a prevent furnaces flashing on fuel load 2020-08-21 16:07:50 +04:00
kay27 6efed85866 prevent divizion by zero in mcl_furnaces 2020-08-21 15:58:17 +04:00
kay27 9c8098c203 try to fix Wuzzy/MineClone2#821 2020-08-21 15:23:15 +04:00
Wuzzy 1878870886 Disable node particles by default 2020-08-21 12:36:35 +02:00
Wuzzy 723a306e1e Anvils: Add tt tooltip to damaged anvils 2020-08-20 19:52:00 +02:00
Wuzzy c7627f0517 Fix minor typo 2020-08-20 19:44:47 +02:00
Wuzzy ce0b31123b Increase smoke anim duration for fire smoke 2020-08-19 20:44:12 +02:00
Wuzzy c2afc82754 Disable some demanding particles by default
Fire smoke, lava droplets
2020-08-19 20:39:05 +02:00
Wuzzy c0aeb2f15f Add lava particles 2020-08-19 20:17:04 +02:00
Wuzzy 101391cbcc Fire nodes spawn smoke particles 2020-08-19 19:32:23 +02:00
Wuzzy 8a39474793 Add smoke particles at torches 2020-08-19 19:14:37 +02:00
Wuzzy 731f42ac88 Rename and move texture: tnt_smoke 2020-08-19 18:47:58 +02:00
Wuzzy f00dc21252 Make dying mobs non-pointable 2020-08-19 18:38:38 +02:00
Wuzzy 28aead0a60 Tweak mob death particles 2020-08-19 18:38:14 +02:00
Wuzzy 7c0c0d4d0c Change particle for instant effects 2020-08-19 17:37:41 +02:00
Wuzzy 91d174b437 Fix incorrect particle name in mcl_potions 2020-08-19 17:07:53 +02:00
Wuzzy 9f43d6a5a5 Add setting to disable node particles 2020-08-19 16:37:28 +02:00
Wuzzy 2a1273b7e3 Add flame particles to torches and furnaces 2020-08-19 16:32:46 +02:00
Wuzzy b14eb70241 Add after_rotate in screwdriver API 2020-08-19 16:27:56 +02:00
Wuzzy 988056ad08 Fix bow in creative mode not having inf. ammo 2020-08-19 15:05:23 +02:00
Wuzzy de8183f07a Fix German translation mistake 2020-08-19 14:48:14 +02:00
Wuzzy 4acf953334 Add critical hit particles for bow 2020-08-19 14:45:37 +02:00
Wuzzy fa9ce11ddd Move potion particles to mcl_particles 2020-08-19 14:12:51 +02:00
Wuzzy 7f1e90ada9 Move note particle to mcl_particles 2020-08-19 13:29:13 +02:00
Wuzzy f91ae540c2 Add leafdecay and anvil damage particles 2020-08-19 13:22:40 +02:00
Wuzzy 80e54bf44d Noteblock spawns note particle 2020-08-19 12:20:12 +02:00
Wuzzy b2e2f27935 Add German translation for Sea Pickle 2020-08-19 11:04:32 +02:00
Wuzzy 1816324fe5 Tweak night vision conditions 2020-08-19 10:53:44 +02:00
Wuzzy 3bdd95fe47 Change night vision description 2020-08-19 10:40:07 +02:00
Wuzzy b2ad6b79bd Fix night vision conflicting with weather skycolor 2020-08-19 10:39:44 +02:00
kay27 ff24052e7f Update mcl_mobitems.ru.tr 2020-08-14 00:38:19 +04:00
Wuzzy 2cc76fb9f3 Update mcl_mobitmes translation 2020-08-13 19:36:02 +02:00
Wuzzy eff6c4c476 Clean up poisonous foods 2020-08-13 19:20:52 +02:00
Wuzzy 152d69f91f mcl_hunger: Remove non-food poison mechanic
It was moved to mcl_potions, so it's OK
2020-08-13 18:44:33 +02:00
Wuzzy cef20edd53 Fix drinking a potion never depleting it 2020-08-13 18:16:53 +02:00
Wuzzy 12ca804488 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-08-13 18:08:33 +02:00
kay27 b8caa2581f Update Russian translation of Brewing 2020-08-11 01:59:58 +04:00
kay27 9537eaead0 Protect from explosions 2020-08-10 22:04:27 +04:00
kay27 c424b036b2 Fix furnaces timing when you leave them or skip the nights, Wuzzy/MineClone2#533 2020-08-10 16:30:55 +04:00
Wuzzy 89b294f8c1 Fix typo in translation 2020-08-10 10:50:48 +02:00
Wuzzy 8573dd69b7 Update mcl_potion translation templates 2020-08-10 10:47:42 +02:00
Wuzzy 578fbf999e Change word in command help 2020-08-10 10:44:57 +02:00
Wuzzy 2a7edbde49 mcl_potions: Move command to own file 2020-08-10 10:40:10 +02:00
Wuzzy f4f976a7a5 Fix potions ignoring on_rightclick of node/objects 2020-08-10 10:30:00 +02:00
Brandon 5637701c4b Correct indentation 2020-08-08 17:51:39 -04:00
Brandon d6c7c9dcd0 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-08-08 17:51:09 -04:00
Brandon 9024c8084d Update how "on_use" is defined for potions. 2020-08-08 17:48:03 -04:00
Wuzzy db1cc2e012 Effect command: Swap arguments 2020-08-08 10:25:23 +02:00
Wuzzy aaa13878c1 Clean up the effect test command a little 2020-08-08 10:14:37 +02:00
Wuzzy a472c30163 Fix indentations in mcl_potions/mcl_brewing 2020-08-08 10:00:16 +02:00
Wuzzy 7104bbd2df Remove tt strings for WIP potions for now 2020-08-08 09:32:38 +02:00
Wuzzy c373c972b3 Fix typo in mcl_brewing: comination 2020-08-08 09:28:47 +02:00
Brandon 48fae05040 Fix problem with charging double potion effect when hit by a tipped_arrow 2020-08-06 17:44:16 -04:00
Brandon 0cfd16fb17 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-08-06 17:31:21 -04:00
Brandon 128e98ca4d Delete dead code 2020-08-06 17:30:49 -04:00
Brandon 0e462ef883 Update potions to not break on contact with liquid nodes. 2020-08-06 17:30:28 -04:00
kay27 6ba7ba981d Russian translation of mcl_potions, mcl_brewing 2020-08-06 19:15:59 +04:00
Brandon 49a5f765bd Save player effects on server shutdown. 2020-08-05 20:18:18 -04:00
Brandon cfcaa4fa12 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-08-05 20:03:56 -04:00
Wuzzy 2e9231ac56 Remove dead chorus flower from Creative 2020-08-05 21:00:30 +02:00
Wuzzy fd724f4c1c Lingering heal/harm potions change at least 1 HP 2020-08-05 20:59:16 +02:00
Wuzzy 3deac5a1c6 Add crafting recipe for dragon's breath 2020-08-05 20:55:07 +02:00
Wuzzy ed6604ee56 Remove incorrect dead chorus flower tooltip 2020-08-05 20:44:41 +02:00
Wuzzy 402205d1ed Do not hide alive chorus flower in Creative 2020-08-05 20:40:34 +02:00
Wuzzy 92591b37dc Make throwable potion entities non-pointable 2020-08-05 20:38:51 +02:00
Wuzzy f5032503d0 Remove dead code in mcl_potions 2020-08-05 20:04:12 +02:00
Wuzzy e310de1754 Fix Shulker spawnegg typo 2020-08-05 19:59:50 +02:00
Wuzzy 53c83a3479 Fix German translation mistake 2020-08-05 19:58:04 +02:00
Wuzzy 1834be9e46 Lingering potion: Reduce timer by constant value 2020-08-05 19:53:14 +02:00
Wuzzy 50bd1b9d5e Update water bottle translate 2020-08-05 19:47:13 +02:00
Wuzzy ff476c29b6 Better lingering for lingering water bottle 2020-08-05 19:44:19 +02:00
Wuzzy 9c304105e9 Add special particles for throwable water bottles 2020-08-05 19:29:21 +02:00
Wuzzy 20455a259f Tweak splash potion particles 2020-08-05 19:06:32 +02:00
Wuzzy 1f8488aba5 Make throwable water bottles useful 2020-08-05 19:00:08 +02:00
Wuzzy 13963d00e5 Fix missing definition of age_next in mcl_fire 2020-08-05 18:04:37 +02:00
Wuzzy e2735e0081 Fix wrong var name in mcl_mobs 2020-08-05 17:29:52 +02:00
Wuzzy b1b50df9ab Add more help to brewing stand 2020-08-05 15:48:28 +02:00
Wuzzy f1616e522a Fix another German typo 2020-08-05 15:26:35 +02:00
Wuzzy 41cf1a4362 Fix some translation typos in German 2020-08-05 15:24:15 +02:00
Wuzzy b49bcda0ac Fix get_translator in mcl_brewing 2020-08-05 15:20:08 +02:00
Wuzzy cbf545ee12 Update mcl_potions translation template and German 2020-08-05 15:18:36 +02:00
Wuzzy e519c62c8b Clean up more potion-related strings 2020-08-05 15:18:30 +02:00
Wuzzy 87bf6c12b2 Add German potion translation 2020-08-05 14:49:23 +02:00
Wuzzy e20a630a19 mcl_brewing, mcl_potions: Update transl. templates 2020-08-05 14:24:21 +02:00
Wuzzy 431cd63865 Add mod.conf to mcl_potions 2020-08-05 14:21:48 +02:00
Wuzzy fe40936065 Remove redundant arrow help string definition 2020-08-05 14:20:53 +02:00
Wuzzy c051a95dae Fix typo in mcl_brewing 2020-08-05 13:56:49 +02:00
Brandon b9a9b1b814 Add pretty weak version of chat commands to give oneself potion effects - for testing 2020-08-03 12:47:42 -04:00
MysticTempest 460d6e837a Fix farm mobs following players slowly, adjust animations to follow suit, increase pig view range slightly, and change the runaway animation from walk to run. 2020-08-03 08:37:58 -05:00
Brandon 4c05c2e70c Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-08-02 20:51:27 -04:00
Brandon 67e4e814f4 move hudbar stuff outside initial statement. 2020-08-02 20:50:29 -04:00
Brandon af1ab424fc Allow potion effects to remain after player logs off. 2020-08-02 20:44:18 -04:00
kay27 125840c9e4 Fix bucket stacks Wuzzy/MineClone2#745 by removing leftovers of metadata usage 2020-08-02 19:46:09 +04:00
kay27 afc6a1bb0f Localize variable in mcl_beds 2020-08-02 05:05:02 +04:00
Brandon 0a5cb628c5 make lowercase to conform to Wuzzy's previous commit. 2020-08-01 08:42:31 -04:00
Brandon 5e26cfcf3d Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-08-01 08:40:41 -04:00
Brandon 2ca2f25e58 Correct tooltip for healing/harming potions 2020-08-01 08:39:50 -04:00
Brandon acea309564 Add poison effect for pufferfish, remove mcl_hunger control for pufferfish effect 2020-08-01 08:36:22 -04:00
Wuzzy 5345dc9eb1 Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 into master 2020-08-01 03:22:03 +02:00
Wuzzy c63028801b Write potion help texts 2020-08-01 03:20:52 +02:00
Wuzzy fb3fade4eb Remove dead code in mcl_brewing 2020-08-01 02:15:48 +02:00
MysticTempest c63c92f597 Copy upstream's pathfinding out of water, then copy & rework the cliff check into a check for land mobs to avoid water. 2020-07-31 08:35:40 -05:00
Wuzzy 23dc977cec Add IRC channel 2020-07-31 15:20:59 +02:00
Wuzzy eec9cd9012 Mark night vision arrows as WIP 2020-07-31 10:45:22 +02:00
Wuzzy 5af124d732 Tweak potion tooltips 2020-07-31 10:43:42 +02:00
Wuzzy 3b95498092 Clean up potion/arrow names 2020-07-31 10:41:44 +02:00
kay27 64f9e39ebd slighty optimize the code 2020-07-31 09:58:28 +02:00
kay27 92385364e5 Fix beds #798 attempt 5 2020-07-31 09:58:28 +02:00
Wuzzy 50fa36aa2c Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-07-29 21:24:49 +02:00
Brandon 1563fc7b96 comment sections of mcl_hunger that "poison" player. This is handled in mcl_potions. 2020-07-28 17:13:54 -04:00
Brandon 78bee21a82 Allow dragon's breath to stack to 64 2020-07-28 17:02:43 -04:00
Brandon fd6028e451 Cleanup HUD bar mechanics 2020-07-27 19:41:07 -04:00
Brandon 9a32bdc967 Update HUD for poison/regen. 2020-07-27 19:17:04 -04:00
Brandon bdd92c6cdb update poison to swap hudbar icons and remove old dead functions 2020-07-27 17:32:48 -04:00
Elias Åström a8eca09822 Fix on_blast for chorus flower crashing 2020-07-27 19:44:55 +02:00
Elias Åström 91b6213e0b Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-07-27 19:28:46 +02:00
Elias Åström e85c00ea02 Show custom name in UI of Chest and Shulker Box 2020-07-27 19:26:01 +02:00
Wuzzy 0cc179acc6 Add warning about bed velocity 2020-07-27 07:49:54 +02:00
kay27 7d1f8ac314 Velocity check adjusted in mcl_beds 2020-07-27 07:49:54 +02:00
kay27 c78270e70b Bed occupation fix 2020-07-27 07:49:54 +02:00
Brandon 6eb810339b Cleanup potion functions - check for player effects at login to ensure no holdovers exist 2020-07-26 17:42:38 -04:00
Elias Åström 37c05cb840 Also save the name when a shulker is placed
Previously only the description was saved in the node meta.
2020-07-26 18:01:36 +02:00
Elias Åström 6095ae17b1 Merge remote-tracking branch 'dbeans/master' 2020-07-26 17:50:09 +02:00
Elias Åström 4827d2a83a Update anvil maximum name length to 35 2020-07-26 17:39:55 +02:00
Brandon 9ef57692ba A little more code cleanup 2020-07-26 07:48:40 -04:00
Lizzy Fleckenstein a31ed90a81 Proper model 2020-07-26 13:28:13 +02:00
Brandon 9dce5581be Code cleanup 2020-07-25 20:59:26 -04:00
Brandon d22805cecd Clean up potion functions. Correct fault where it's possible to index a nil value. 2020-07-25 20:40:13 -04:00
Brandon 834ce1f611 Correct issue where awkward splash wouldn't brew 2020-07-25 15:27:04 -04:00
Brandon e5f0370c17 Correct arrow naming convention 2020-07-25 15:26:42 -04:00
Brandon e603a08f3c Correct potion color scheme 2020-07-25 15:26:22 -04:00
Lizzy Fleckenstein 21c6815839 Added End Crystal 2020-07-25 13:32:35 +02:00
MysticTempest 56958ab0c9 Fix mobs getting stuck in water, fix mobs falling off cliffs, and lower spider speed so cliff_danger check is properly applied. 2020-07-24 21:15:40 -05:00
Brandon bf38131520 Corrected poison and other damage functions 2020-07-24 19:39:23 -04:00
Brandon a53a98fff6 updated arrow color scheme. 2020-07-24 19:22:57 -04:00
Brandon 8c5943b34c Correct other issues in inverting swiftness. 2020-07-24 19:15:00 -04:00
Brandon ebfe9674e1 Correct issue with inverting swiftness to slowness. 2020-07-24 19:12:03 -04:00
Brandon c37e43df4e Merge branch 'master' of https://git.minetest.land/Wuzzy/MineClone2 2020-07-24 19:05:14 -04:00
Brandon d228da1da7 allow stackable dragon breath 2020-07-24 19:02:54 -04:00
kay27 d76b1a9065 Russian translation: commandblock: advanced topics/usage 2020-07-24 19:10:58 +02:00
kay27 e19c00cd44 Russian translation: mcl_maps 2020-07-24 19:09:17 +02:00
dBeans f961a72c33 Make shulker boxes preserve name when placed 2020-07-24 12:44:21 +02:00
Wuzzy cd3e87bf57 Fix duplicate help entries for brewing stand 2020-07-23 23:23:03 +02:00
Wuzzy e3c22cb072 Move depends to mod.conf in mcl_brewing 2020-07-23 23:16:36 +02:00
Wuzzy fa76f81f92 Change mcl_brewing file permissions 2020-07-23 23:15:37 +02:00
Wuzzy 49d5e49999 Upgrade hudbars to 2.3.2 2020-07-23 23:06:10 +02:00
Wuzzy a430772c16 Fix incorrect string in mesecons_commandblock 2020-07-23 22:43:16 +02:00
Wuzzy ee52990db1 Remove empty Russian translation of mcl_maps 2020-07-23 22:36:25 +02:00
Wuzzy 7c93f3f9f7 Remove trailing spaces in Russian translation 2020-07-23 22:35:09 +02:00
Wuzzy ac518fa548 Merge branch 'master' of https://git.minetest.land/kay2777/MineClone2 into ru 2020-07-23 22:33:10 +02:00
Wuzzy a3d70e45d1 Fix incorrect dirt help 2020-07-23 22:29:16 +02:00
Brandon dc3a991705 Correct crash from on_use = nil 2020-07-22 17:57:02 -04:00
Brandon 8ac54febba Adjust dragon's breath color and don't splash it 2020-07-22 17:52:47 -04:00
Brandon f2906bee3a Add really cool header text 2020-07-22 17:46:49 -04:00
Brandon 927ba10c34 Update dragon breath image. 2020-07-22 17:46:34 -04:00
Brandon b45b4a44e5 Add brewable dragons breath with chorus flower 2020-07-22 17:42:10 -04:00
Brandon c4271cf13d Correct crash when no arrow is in the inventory and the bow is drawn. 2020-07-21 18:55:41 -04:00
Brandon 623f60ab79 correct elseif statement 2020-07-20 19:50:17 -04:00
Brandon 31f57a51e0 give bow a bit more power... 2020-07-20 19:49:10 -04:00
Brandon 843f2d2a80 Correct issue where player/entities dies before effect is given 2020-07-20 19:48:58 -04:00
Brandon 43c4b355ce Fix issue with objects/players dying before the effect runs, which won't be applied... 2020-07-20 19:07:10 -04:00
Brandon bb5aa33bad Remove splash potion arrow recipe 2020-07-20 18:36:37 -04:00
kay27 0b05431285 Merge remote-tracking branch 'upstream/master' 2020-07-20 19:44:06 +00:00
Brandon 26315d44cf Add the ability to give use lingering potions to tip arrows.
Corrected issue with bow not finding potion arrows in inventory.
2020-07-19 21:08:50 -04:00
kay27 ba51686e6c Russian translation 2020-07-20 00:11:13 +00:00
Brandon 0f5b6b7ce0 Initial commit to potion tipped arrows. 2020-07-19 18:56:18 -04:00
Brandon 1eeb0511de Correct undeclared local obj in enderman line 318 2020-07-19 18:32:33 -04:00
Brandon fa86a09fd5 Add splash/lingering water 2020-07-17 17:25:49 -04:00
Brandon 2b4b37a439 Update longdesc for mundane and thick potions 2020-07-17 17:09:51 -04:00
Brandon 787769cb92 Fix brewing thick potions and splash water potions 2020-07-17 17:05:40 -04:00
Brandon 5e77c90bb7 adjust tooltip generation - use even numbers of 5 2020-07-16 21:02:21 -04:00
Brandon 850edb564d Scale down leaping potion effect, cleanup tooltip generation. 2020-07-16 20:56:00 -04:00
Brandon 64a2a6bb53 Move variable declaration out of loops to increase performance. 2020-07-16 20:20:13 -04:00
Brandon 1dda98fa4c Move variable declaration out of loops for better performance. Correct for dropping duplicate items on break. 2020-07-16 20:14:57 -04:00
Elias Åström ea1ad14f72 Fix sound/particle bug in mcl_explosions 2020-07-17 00:39:33 +02:00
Elias Åström ca9578d50c Make dried kelp craftable from dried kelp block 2020-07-17 00:17:18 +02:00
Wuzzy 90cc3b9659 Fix crash in mcl_mobs 2020-07-16 20:26:41 +02:00
David McMackins II 59b6385d10 Fix bug where powered rails would not accelerate a fueled minecart 2020-03-17 15:00:12 -05:00
1501 changed files with 49761 additions and 18876 deletions

13
API.md
View File

@ -17,6 +17,10 @@ Items can have these fields:
anvil.
See `mcl_banners` for an example.
Tools can have these fields:
* `_mcl_diggroups`: Specifies the digging groups that a tool can dig and how
efficiently. See `_mcl_autogroup` for more information.
All nodes can have these fields:
* `_mcl_hardness`: Hardness of the block, ranges from 0 to infinity (represented by -1). Determines digging times. Default: 0
@ -39,7 +43,7 @@ A lot of things are possible by using one of the APIs in the mods. Note that not
* Dispenser support: `ITEMS/REDSTONE/mcl_dispensers`
## Mobs
* Mobs: `ENTITIES/mcl_mods`
* 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.
@ -67,6 +71,9 @@ chances are good that it works out of the box.
* 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!
@ -79,12 +86,10 @@ The following APIs may be subject to change in future. You could already use the
### Planned APIs
* Flowers
* Saplings and trees
* Custom banner patterns
* Custom dimensions
* Custom portals
* Music discs
* Dispenser and dropper support
* Proper sky and weather APIs
* Explosion API

View File

@ -1,82 +1,105 @@
# Contributing to MineClone 2
So you want to MineClone 2?
So you want to contribute to MineClone 2?
Wow, thank you! :-)
But first, some things to note:
MineClone 2's development target is to make a free software clone of Minecraft,
***version 1.11***, ***PC edition***.
***version 1.12***, ***PC edition***, *** + Optifine features supported by the Minetest Engine ***.
MineClone 2 is maintained by one person. Namely, Wuzzy. You can find me,
Wuzzy, in the Minetest forums (forums.minetest.net), in IRC in the #minetest
MineClone 2 is maintained by three persons. Namely, kay27, EliasFleckenstein and jordan4ibanez. You can find us
in the Minetest forums (forums.minetest.net), in IRC in the #mineclone2
channel on irc.freenode.net. And finally, you can send e-mails to
<Wuzzy2@mail.ru>.
<eliasfleckenstein@web.de> or <kay27@bk.ru>.
There is **no** guarantee I will accept anything from anybody.
By sending me patches or asking me to include your changes in this game,
By sending us patches or asking us to include your changes in this game,
you agree that they fall under the terms of the LGPLv2.1, which basically
means they will become part of a free software.
## The suggested workflow
I don't **dictate** your workflow, but in order to work with me in an efficient
way, you can follow my suggestions.
We don't **dictate** your workflow, but in order to work with us in an efficient
way, you can follow these suggestions:
For small and medium changes:
* Fork the repository
* Do your change in a new branch
* Upload the repository somewhere where it can be accessed from the Internet and
notify me
* Create a pull request to get your changes merged into master
For small changes, sending me a patch is also good.
For small changes, sending us a patch is also good.
For big changes: Same as above, but consider notifying me first to avoid
For big changes: Same as above, but consider notifying us first to avoid
duplicate work and possible tears of rejection. ;-)
For people that I trust, I might give them direct commit access to this
For trusted people, we might give them direct commit access to this
repository. In this case, you obviously don't need to fork, but you still
need to show your contributions align with the project goals. I still
reserve the right to revert everything that I don't like.
For bigger changes, I strongly recommend to use feature branches and
need to show your contributions align with the project goals. We still
reserve the right to revert everything that we don't like.
For bigger changes, we strongly recommend to use feature branches and
discuss with me first.
Contributors will be credited in `README.md`.
If your code causes bugs and crashes, it is your responsibility to fix them as soon as possible.
## Quality remarks
Again: There is ***no*** guarantee I will accept anything from anybody.
But I will gladly take in code from others when I feel it saves me work
in the long run.
We mostly use plain merging rather than rebasing or squash merging.
### Inclusion criteria
Depending on what you add, the chances for inclusion vary:
Your commit names should be relatively descriptive, e.g. when saying "Fix #issueid", the commit message should also contain the title of the issue.
### High chance for inclusion
* Gameplay features in Minecraft which are missing in MineClone 2
Contributors will be credited in `CREDITS.md`.
### Medium chance for inclusion (discuss first)
* Features which don't a impact on gameplay
* GUI improvement
* Features from pocket or console edition
## Code Style
### Low chance for inclusion (discuss/optimize first)
* Overhaul of architecture / mod structure
* Mass-itemstring changes all over the place
* Added files have a unusual high file size
* Indentation looks like crazy
* Single commits which add several unrelated things
* Gameplay features which don't exist in Minecraft
Each mod must provide `mod.conf`.
Each mod which add API functions should store functions inside a global table named like the mod.
Public functions should not use self references but rather just access the table directly.
Functions should be defined in this way:
```lua
function mcl_xyz.stuff(param) end
```
Insteed of this way:
```lua
mcl_xyz.stuff = function(param) end
```
Indentation must be unified, more likely with tabs.
### Instant rejection
* Proprietary **anything**
* Code contains `minetest.env` anywhere
Time sensitive mods should make a local copy of most used API functions to improve performances.
```lua
local vector = vector
local get_node = minetest.get_node
```
## Coding style guide
* Indentations should reflect the code flow
* Use tabs, not spaces for indentation (tab size = 8)
* Never use `minetest.env`
## Features > 1.12
If you want to make a feature that was added in a Minecraft version later than 1.12, you should fork MineClone5 (mineclone5 branch in the repository) and add your changes to this.
## What we accept
* Every MC features up to version 1.12 JE.
* Every already finished and working good features from versions above (only when making a MineClone5 PR / Contribution).
* Except features which couldn't be done easily and bugfree because of Minetest engine limitations. Eg. we CAN extend world boundaries by playing with map chunks, just teleporting player onto next layer after 31000 , but it would cost too much (time, code, bugs, performance, stability, etc).
* Some features, approved by the rest of the community, I mean maybe some voting and really missing any negative feedback.
## What we reject
* Any features which cause critical bugs, sending them to rework/fix or trying to fix immediately.
* Some small portions of big entirely missing features which just definitely break gamplay balance give nothing useful
* Controversial features, which some people support while others do not should be discussed well, with publishing forum announcements, at least during the week. In case if there are still doubts - send them into the mod.
## Reporting bugs
Report all bugs and missing Minecraft features here:
<https://git.minetest.land/Wuzzy/MineClone2/issues>
<https://git.minetest.land/MineClone2/MineClone2/issues>
## Direct discussion
We have an IRC channel! Join us on #mineclone2 in freenode.net.
<ircs://irc.freenode.net:6697/#mineclone2>
## Creating releases
* Launch MineClone2 to make sure it still runs
* Update the version number in README.md
* Use `git tag <version number>` to tag the latest commit with the version number
* Push to repo (don't forget `--tags`!)
* Update ContentDB (https://content.minetest.net/packages/Wuzzy/mineclone2/)
* Update first post in forum thread (https://forum.minetest.net/viewtopic.php?f=50&t=16407)
* Post release announcement and changelog in forums

118
CREDITS.md Normal file
View File

@ -0,0 +1,118 @@
# Credits
## Creator of MineClone
* davedevils
## Creator of MineClone2
* Wuzzy
## Maintainers
* Fleckenstein
* kay27
* jordan4ibanez
## Developers
* bzoss
* AFCMS
* epCode
* ryvnf
* iliekprogrammar
* MysticTempest
* Rootyjr
* Nicu
* aligator
* Code-Sploit
* NO11
## Contributors
* Laurent Rocher
* HimbeerserverDE
* TechDudie
* Alexander Minges
* ArTee3
* ZeDique la Ruleta
* pitchum
* wuniversales
* Bu-Gee
* David McMackins II
* Nicholas Niro
* Wouters Dorian
* Blue Blancmange
* Jared Moody
* Li0n
* Midgard
* Saku Laesvuori
* Yukitty
* ZedekThePD
* aldum
* dBeans
* nickolas360
* yutyo
* ztianyang
* j45
## MineClone5
* kay27
* Debiankaios
* epCode
* NO11
* j45
## Original Mod Authors
* Wuzzy
* Fleckenstein
* BlockMen
* TenPlus1
* PilzAdam
* ryvnf
* stujones11
* Arcelmi
* celeron55
* maikerumine
* GunshipPenguin
* Qwertymine3
* Rochambeau
* rubenwardy
* stu
* jordan4ibanez
* 4aiman
* Kahrl
* Krock
* UgnilJoZ
* lordfingle
* 22i
* bzoss
* kilbith
* xeranas
* kddekadenz
* sofar
* 4Evergreen4
* jordan4ibanez
* paramat
## 3D Models
* 22i
* tobyplowy
* epCode
## Textures
* XSSheep
* Wuzzy
* kingoscargames
* leorockway
* xMrVizzy
* yutyo
* NO11
## Translations
* Wuzzy
* Rocher Laurent
* wuniversales
* kay27
* pitchum
## Special thanks
* celeron55 for creating Minetest
* Jordach for the jukebox music compilation from Big Freaking Dig
* The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game
* Notch and Jeb for being the major forces behind Minecraft

View File

@ -21,7 +21,7 @@ The basic digging time groups determine by which tools a node can be dug.
* `swordy=1`: Diggable by sword (any material), and this node is *not* a cobweb
* `swordy_cobweb=1`: Diggable by sword (any material), and this node is a cobweb
* `shearsy=1`: Diggable by shears, and this node is *not* wool
* `shearsy=wool=1`: Diggable by shears, and this node is wool
* `shearsy_wool=1`: Diggable by shears, and this node is wool
* `handy=1`: Breakable by hand and this node gives it useful drop when dug by hand. All nodes which are breakable by pickaxe, axe, shovel, sword or shears are also automatically breakable by hand, but not neccess
* `creative_breakable=1`: Block is breakable by hand in creative mode. This group is implied if the node belongs to any other digging group
@ -70,6 +70,7 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
* `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
@ -96,6 +97,8 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
* `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
@ -146,7 +149,7 @@ These groups are used mostly for informational purposes
* `trapdoor=2`: Open trapdoor
* `glass=1`: Glass (full cubes only)
* `rail=1`: Rail
* `music_record`: Music Disc (rating is track ID)
* `music_record`: Item is Music Disc
* `tnt=1`: Block is TNT
* `boat=1`: Boat
* `minecart=1`: Minecart
@ -197,6 +200,7 @@ These groups are used mostly for informational purposes
* `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.

52
LEGAL.md Normal file
View File

@ -0,0 +1,52 @@
# Legal information
This is a fan game, not developed or endorsed by Mojang AB.
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.
MineClone 2 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.
This program 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 General Public License (in the LICENSE.txt file) for more
details.
In the mods you might find in the read-me or license
text files a different license. This counts as dual-licensing.
You can choose which license applies to you: Either the
license of MineClone 2 (GNU GPLv3) or the mod's license.
MineClone 2 is a direct continuation of the discontinued MineClone
project by davedevils.
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.
## License of media (textures and sounds)
No non-free licenses are used anywhere.
The textures, unless otherwise noted, are based on the Pixel Perfection resource pack for Minecraft 1.11,
authored by XSSheep. Most textures are verbatim copies, while some textures have been changed or redone
from scratch.
The glazed terracotta textures have been created by (MysticTempest)[https://github.com/MysticTempest].
Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/>
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
The main menu images are release under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
All other files, unless mentioned otherwise, fall under:
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
See README.txt in each mod directory for detailed information about other authors.

View File

@ -1,40 +0,0 @@
# Missing features in Minetest to recreate Minecraft features
A side goal of the MineClone 2 project is to find any shortcomings of Minetest which make it impossible to recreate a Minecraft feature exactly.
This file lists some of the missing features in Minetest which MineClone 2 would require.MineClone 2 would require.MineClone 2 would require.MineClone 2 would require.
## No workaround possible
For these features, no easy Lua workaround could be found.
### Lua API
#### Tools/wielded item
- “Lock” hotbar for a brief time after using an item, making it impossible to switch item or to attach/mine/build until the delay is over (For eating with delay)
- Tool charging: Holding down the mouse and releasing it, applying a “power level” (For bow and arrows, more charge = higher arrow range) ([issue 5212](https://github.com/minetest/minetest/issues/5212))
- [Dual Wielding](http://minecraft.gamepedia.com/Dual_wield)
- Eating/drinking animation ([issue 2811](https://github.com/minetest/minetest/issues/2811))
#### Nodes
- Light level 15 for nodes (not sunlight)
- Nodes makes light level drop by 2 or or more per node ([issue 5209](https://github.com/minetest/minetest/issues/5209))
## Interface
- Inventory: Hold down right mouse button while holding an item stack to drop items into the slots as you move the mouse. Makes crafting MUCH faster
- Sneak+Leftclick on crafting output crafts as many items as possible and immediately puts it into the player inventory ([issue 5211](https://github.com/minetest/minetest/issues/5211))
- Sneak+click on inventory slot should be able to put items into additional “fallback inventories” if the first inventory is full. Required for large chests
- Sneak+click puts items in different inventories depending on the item type (maybe group-based)? Required for sneak-clicking to armor slots
## Workaround theoretically possible
For these features, a workaround (or hack ;-)) by using Lua is theoretically possible. But engine support would be clearly better, more performant, more reliable, etc.
### Lua API
#### Nodes
- Change walking speed on block (soul sand)
- Change jumping height on block (soul sand),
- Change object movement speed *through* a block, but for non-liquids (for cobweb)
- Add `on_walk_over` event
- Set frequency in which players lose breath. 2 seconds are hardcoded in Minetest, in Minecraft it's 1 second
- Set damage frequency of `damage_per_second`. In Minecraft many things damage players every half-second rather than every second
- Possible to damage players directly when they are with the head inside. This allows to add Minecraft-like suffocation
#### Nice-to-haye
- Utility function to rotate pillar-like nodes, requiring only 3 possible orientations (X, Y, Z). Basically this is `minetest.rotate_node` but with less orientations; the purpur pillar would mess up if a mirrored rotation would be possible. This is already implemented in MCL2, See `mcl_util` for more infos

205
README.md
View File

@ -1,8 +1,8 @@
# MineClone 2
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB.
Developed by many people. Not developed or endorsed by Mojang AB.
Version: 0.66.2
Version: 0.72.0 (in development)
### Gameplay
You start in a randomly-generated world made entirely of cubes. You can explore
@ -14,9 +14,10 @@ Or you can play in “creative mode” in which you can build almost anything in
#### Gameplay summary
* Sandbox-style gameplay, no goals (for now)
* 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
@ -64,16 +65,8 @@ map builders. They can not be obtained in-game or in the creative inventory.
Use the `/giveme` chat command to obtain them. See the in-game help for
an explanation.
#### Incomplete items
These items do not work yet, but you can get them with `/giveme` for testing:
* Minecart with Chest: `mcl_minecarts:chest_minecart`
* Minecart with Furnace: `mcl_minecarts:furnace_minecart`
* Minecart with Hopper: `mcl_minecarts:hopper_minecart`
* Minecart with Command Block: `mcl_minecarts:command_block_minecart`
## Installation
This game requires [Minetest](http://minetest.net) to run (version 5.0.0 or
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 MineClone 2 in development versions of Minetest.
@ -82,27 +75,43 @@ To install MineClone 2 (if you haven't already), move this directory into the
“games” directory of your Minetest data directory. Consult the help of
Minetest to learn more.
## Useful links
The MineClone2 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>
## Project description
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
* **Target of development: Minecraft, PC Edition, version 1.11** (later known as “Java Edition”)
* Features of later Minecraft versions might sneak in, but they have a low priority
* In general, Minecraft is aimed to be cloned as good as Minetest currently permits (no hacks)
* **Target of development: Minecraft, PC Edition, version 1.12** (later known as “Java Edition”)
* MineClone2 also includes Optifine features supported by the Minetest
* In general, Minecraft is aimed to be cloned as good as possible
* Cloning the gameplay has highest priority
* MineClone 2 will use different graphics and sounds, but with a similar style
* Cloning the interface has no priority. It will only be roughly imitated
* Limitations found in Minetest will be written down and reported in the course of development
* MineClone 2 will use different assets, but with a similar style
* Limitations found in Minetest will be documented in the course of development
* Features of later Minecraft versions are collected in the mineclone5 branch
## Using features from newer versions of Minecraft
For > 1.12 features, checkout MineClone5. It includes features from newer Minecraft versions.
Download it here: https://git.minetest.land/MineClone2/MineClone2/src/branch/mineclone5
## Completion status
This game is currently in **alpha** stage.
It is playable, but unfinished, many bugs are to be expected.
Backwards-compability is *not* guaranteed, updating your world might cause small and
big bugs (such as “missing node” errors or even crashes).
This game is currently in **beta** stage.
It is playable, but not yet feature-complete.
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:
* Tools, weapons
* Armor (unbalanced)
* 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
@ -116,13 +125,17 @@ The following main features are available:
* 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 (does not interact with redstone)
* Slime block
* Small plants and saplings
* Dyes
* Banners
@ -134,24 +147,19 @@ The following main features are available:
* Creative inventory
* Farming
* Writable books
* A few server commands
* Commands
* Villages
* The End
* And more!
The following features are incomplete:
* Generated structures (especially villages)
* NPCs
* Some monsters and animals
* Redstone-related things
* The End
* Enchanting
* Experience
* Status effects
* Brewing, potions, tipped arrows
* Special minecarts
* A couple of non-trivial blocks and items
Bonus features (not found in Minecraft 1.11):
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
@ -176,139 +184,14 @@ Technical differences from Minecraft:
* Different textures (Pixel Perfection)
* Different sounds (various sources)
* Different engine (Minetest)
* Different easter eggs
… and finally, MineClone 2 is free software (“free” as in “freedom”)!
## Reporting bugs
Please report all bugs and missing Minecraft features here:
<https://git.minetest.land/Wuzzy/MineClone2/issues>
## Other readme files
* `LICENSE.txt`: The GPLv3 license text
* `CONTRIBUTING.md`: Information for those who want to contribute
* `MISSING_ENGINE_FEATURES.md`: List of missing features in Minetest which MineClone 2 would need for improvement
* `API.md`: For Minetest modders who want to mod this game
## Credits
There are so many people to list (sorry). Check out the respective mod directories for details. This section is only a rough overview of the core authors of this game.
### Coding
* [Wuzzy](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=3082): Main programmer of most mods
* davedevils: Creator of MineClone on which MineClone 2 is based on
* [ex-bart](https://github.com/ex-bart): Redstone comparators
* [Rootyjr](https://github.com/Rootyjr): Fishing rod and bugfixes
* [aligator](https://github.com/aligator): Improvement of doors
* [ryvnf](https://github.com/ryvnf): Explosion mechanics
* MysticTempest: Bugfixes
* [bzoss](https://github.com/bzoss): Status effects, potions, brewing stand
* Lots of other people: TO BE WRITTEN (see mod directories for details)
#### Mod credits (summary)
* `controls`: Arcelmi
* `flowlib`: Qwertymine13
* `walkover`: lordfingle
* `drippingwater`: kddekadenz
* `mobs_mc`: maikerumine, 22i and others
* `awards`: rubenwardy
* `screwdriver`: RealBadAngel, Maciej Kastakin, Minetest contributors
* `xpanes`: Minetest contributors
* `mesecons` mods: Jeija and contributors
* `wieldview`: Stuart Jones
* `mcl_meshhand`: Based on `newhand` by jordan4ibanez
* `mcl_mobs`: Based on Mobs Redo [`mobs`] by TenPlus1 and contributors
* Most other mods: Wuzzy
Detailed credits for each mod can be found in the individual mod directories.
### Graphics
* [XSSheep](http://www.minecraftforum.net/members/XSSheep): Main author; creator of the Pixel Perfection resource pack of Minecraft 1.11
* [Wuzzy](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=3082): Main menu imagery and various edits and additions of texture pack
* [kingoscargames](https://github.com/kingoscargames): Various edits and additions of existing textures
* [leorockway](https://github.com/leorockway): Some edits of mob textures
* [xMrVizzy](https://minecraft.curseforge.com/members/xMrVizzy): Glazed terracotta (textures are subject to be replaced later)
* yutyo <tanakinci2002@gmail.com>: MineClone 2 logo
* Other authors: GUI images
### Translations
* Wuzzy: German
* Rocher Laurent <rocherl@club-internet.fr>: French
* wuniversales: Spanish
* kay27 <kay27@bk.ru>: Russian
### Models
* [22i](https://github.com/22i): Creator of all models
* [tobyplowy](https://github.com/tobyplowy): UV-mapping fixes to said models
### Sounds and music
Various sources. See the respective mod directories for details.
### Special thanks
* davedevils for starting MineClone, the original version of this game
* celeron55 for creating Minetest
* Minetest's modding community for providing a huge selection of mods, some of which ended up in MineClone 2
* Jordach for the jukebox music compilation from Big Freaking Dig
* The workaholics who spent way too much time writing for the Minecraft Wiki. It's an invaluable resource for creating this game
* Notch and Jeb for being the major forces behind Minecraft
* XSSheep for creating the Pixel Perfection resource pack
* [22i](https://github.com/22i) for providing great models and support
* [maikerumine](http://github.com/maikerumine) for kicking off mobs and biomes
## Info for programmers
You find interesting and useful infos in `API.md`.
This project is currently mostly a one-person project.
## Legal information
This is a fan game, not developed or endorsed by Mojang AB.
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 Wuzzy, davedevils and countless others)
is an imitation of Minecraft.
MineClone 2 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.
This program 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 General Public License (in the LICENSE.txt file) for more
details.
In the mods you might find in the read-me or license
text files a different license. This counts as dual-licensing.
You can choose which license applies to you: Either the
license of MineClone 2 (GNU GPLv3) or the mod's license.
MineClone 2 is a direct continuation of the discontinued MineClone
project by davedevils.
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.
### License of media (textures and sounds)
No non-free licenses are used anywhere.
The textures, unless otherwise noted, are based on the Pixel Perfection resource pack for Minecraft 1.11,
authored by XSSheep. Most textures are verbatim copies, while some textures have been changed or redone
from scratch.
The glazed terracotta textures have been created by (MysticTempest)[https://github.com/MysticTempest].
Source: <https://www.planetminecraft.com/texture_pack/131pixel-perfection/>
License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)
The main menu images are release under: [CC0](https://creativecommons.org/publicdomain/zero/1.0/)
All other files, unless mentioned otherwise, fall under:
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
See README.txt in each mod directory for detailed information about other authors.
* `LEGAL.md`: Legal information
* `CREDITS.md`: List of everyone who contributed

View File

@ -1 +1 @@
A survival sandbox game. Survive, gather, hunt, mine, build, explore, and do much more. Faithful clone of Minecraft 1.11. This is a work in progress! Expect bugs!
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!

BIN
menu/Header.blend Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -1,5 +1,8 @@
# This is a game specific minetest.conf file, do not edit
# If any of these settings are set in your minetest.conf file in ~/.minetest (Linux) or in the root directory of the game (Run in place/Windows)
# They will override these settings
# Basic game rules
time_speed = 72
@ -31,3 +34,14 @@ mgvalleys_spflags = noaltitude_chill,noaltitude_dry,nohumid_rivers,vary_river_de
# 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

View File

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

View File

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

View File

@ -1,149 +1,365 @@
--[[ Mining times. Yeah, mining times … Alright, this is going to be FUN!
--[[
This mod implements a HACK to make 100% sure the digging times of all tools
match Minecraft's perfectly. The digging times system of Minetest is very
different, so this weird group trickery has to be used. In Minecraft, each
block has a hardness and the actual Minecraft digging time is determined by
this:
This mod does include a HACK to make 100% sure the digging times of all tools match Minecraft's perfectly.
The digging times system of Minetest is very different, so this weird group trickery has to be used.
In Minecraft, each block has a hardness and the actual Minecraft digging time is determined by this:
1) The block's hardness
2) The tool being used
3) Whether the tool is considered as eligible for the block
2) The tool being used (the tool speed and its efficiency level)
3) Whether the tool is considered as "eligible" for the block
(e.g. only diamond pick eligible for obsidian)
See Minecraft Wiki <http://minecraft.gamepedia.com/Minecraft_Wiki> for more information.
In MineClone 2, all diggable node have the hardness set in the custom field _mcl_hardness (0 by default).
The nodes are also required to specify the eligible tools in groups like pickaxey, shovely, etc.
This mod then calculates the real digging time based on the node meta data. The real digging times
are then added into mcl_autogroup.digtimes where the table indices are group rating and the values are the
digging times in seconds. These digging times can be then added verbatim into the tool definitions.
See Minecraft Wiki <http://minecraft.gamepedia.com/Minecraft_Wiki> for more
information.
Example:
mcl_autogroup.digtimes.pickaxey_dig_diamond[1] = 0.2
How the mod is used
===================
This menas that when a node has been assigned the group pickaxey_dig_diamond=1, it can be dug by the
diamond pickaxe in 0.2 seconds.
In MineClone 2, all diggable nodes have the hardness set in the custom field
"_mcl_hardness" (0 by default). These values are used together with digging
groups by this mod to create the correct digging times for nodes. Digging
groups are registered using the following code:
mcl_autogroup.register_diggroup("shovely")
mcl_autogroup.register_diggroup("pickaxey", {
levels = { "wood", "gold", "stone", "iron", "diamond" }
})
The first line registers a simple digging group. The second line registers a
digging group with 5 different levels (in this case one for each material of a
pickaxes).
This strange setup with mcl_autogroup has been done to minimize the amount of required digging times
a single tool needs to use. If this is not being done, the loading time will increase considerably
(>10s).
Nodes indicate that they belong to a particular digging group by being member of
the digging group in their node definition. "mcl_core:dirt" for example has
shovely=1 in its groups. If the digging group has multiple levels the value of
the group indicates which digging level the node requires.
"mcl_core:stone_with_gold" for example has pickaxey=4 because it requires a
pickaxe of level 4 be mined.
]]
For tools to be able to dig nodes of digging groups they need to use the have
the custom field "_mcl_diggroups" function to get the groupcaps. The value of
this field is a table which defines which groups the tool can dig and how
efficiently.
local materials = { "wood", "gold", "stone", "iron", "diamond" }
local basegroups = { "pickaxey", "axey", "shovely" }
local minigroups = { "handy", "shearsy", "swordy", "shearsy_wool", "swordy_cobweb" }
local divisors = {
["wood"] = 2,
["gold"] = 12,
["stone"] = 4,
["iron"] = 6,
["diamond"] = 8,
["handy"] = 1,
["shearsy"] = 15,
["swordy"] = 1.5,
["shearsy_wool"] = 5,
["swordy_cobweb"] = 15,
}
_mcl_diggroups = {
handy = { speed = 1, level = 1, uses = 0 },
pickaxey = { speed = 1, level = 0, uses = 0 },
}
mcl_autogroup = {}
mcl_autogroup.digtimes = {}
mcl_autogroup.creativetimes = {} -- Copy of digtimes, except that all values are 0. Used for creative mode
The "uses" field indicate how many uses (0 for infinite) a tool has when used on
the specified digging group. The "speed" field is a multiplier to the dig speed
on that digging group.
for m=1, #materials do
for g=1, #basegroups do
mcl_autogroup.digtimes[basegroups[g].."_dig_"..materials[m]] = {}
mcl_autogroup.creativetimes[basegroups[g].."_dig_"..materials[m]] = {}
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
for g=1, #minigroups do
mcl_autogroup.digtimes[minigroups[g].."_dig"] = {}
mcl_autogroup.creativetimes[minigroups[g].."_dig"] = {}
-- 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
local overwrite = function()
-- 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 groups_changed = false
local newgroups = table.copy(ndef.groups)
if (nname ~= "ignore" and ndef.diggable) then
-- Automatically assign the “solid” group for solid nodes
-- Automatically assign the "solid" group for solid nodes
if (ndef.walkable == nil or ndef.walkable == true)
and (ndef.collision_box == nil or ndef.collision_box.type == "regular")
and (ndef.node_box == nil or ndef.node_box.type == "regular")
and (ndef.groups.not_solid == 0 or ndef.groups.not_solid == nil) then
newgroups.solid = 1
groups_changed = true
end
-- Automatically assign the “opaque” group for opaque nodes
-- Automatically assign the "opaque" group for opaque nodes
if (not (ndef.paramtype == "light" or ndef.sunlight_propagates)) and
(ndef.groups.not_opaque == 0 or ndef.groups.not_opaque == nil) then
newgroups.opaque = 1
groups_changed = true
end
local function calculate_group(hardness, material, diggroup, newgroups, actual_rating, expected_rating)
local time, validity_factor
if actual_rating >= expected_rating then
-- Valid tool
validity_factor = 1.5
else
-- Wrong tool (higher digging time)
validity_factor = 5
end
time = (hardness * validity_factor) / divisors[material]
if time <= 0.05 then
time = 0
else
time = math.ceil(time * 20) / 20
end
table.insert(mcl_autogroup.digtimes[diggroup], time)
table.insert(mcl_autogroup.creativetimes[diggroup], 0)
newgroups[diggroup] = #mcl_autogroup.digtimes[diggroup]
return newgroups
end
--local creative_breakable = false
-- Hack in digging times
local hardness = ndef._mcl_hardness
if not hardness then
hardness = 0
end
-- Assign groups used for digging this node depending on
-- the registered digging groups
for g, gdef in pairs(mcl_autogroup.registered_diggroups) do
--creative_breakable = true
local index = hardness_lookup[g][ndef._mcl_hardness or 0]
if ndef.groups[g] then
if gdef.levels then
newgroups[g .. "_dig_default"] = index
-- Handle pickaxey, axey and shovely
for _, basegroup in pairs(basegroups) do
if (hardness ~= -1 and ndef.groups[basegroup]) then
for g=1,#materials do
local diggroup = basegroup.."_dig_"..materials[g]
newgroups = calculate_group(hardness, materials[g], diggroup, newgroups, g, ndef.groups[basegroup])
groups_changed = true
end
end
end
for m=1, #minigroups do
local minigroup = minigroups[m]
if hardness ~= -1 then
local diggroup = minigroup.."_dig"
-- actual rating
local ar = ndef.groups[minigroup]
if ar == nil then
ar = 0
end
if (minigroup == "handy")
or
(ndef.groups.shearsy_wool and minigroup == "shearsy_wool" and ndef.groups.wool)
or
(ndef.groups.swordy_cobweb and minigroup == "swordy_cobweb" and nname == "mcl_core:cobweb")
or
(ndef.groups[minigroup] and minigroup ~= "swordy_cobweb" and minigroup ~= "shearsy_wool") then
newgroups = calculate_group(hardness, minigroup, diggroup, newgroups, ar, 1)
groups_changed = true
for i = ndef.groups[g], #gdef.levels do
newgroups[g .. "_dig_" .. gdef.levels[i]] = index
end
else
newgroups[g .. "_dig"] = index
end
end
end
if groups_changed then
minetest.override_item(nname, {
groups = newgroups
})
end
-- Automatically assign the node to the
-- creative_breakable group if it belongs to any digging
-- group.
newgroups["creative_breakable"] = 1
minetest.override_item(nname, {
groups = newgroups
})
end
end
for tname, tdef in pairs(minetest.registered_tools) do
-- Assign groupcaps for digging the registered digging groups
-- depending on the _mcl_diggroups in the tool definition
if tdef._mcl_diggroups then
local toolcaps = table.copy(get_tool_capabilities(tdef))
toolcaps.groupcaps = mcl_autogroup.get_groupcaps(tname)
minetest.override_item(tname, {
tool_capabilities = toolcaps
})
end
end
end

View File

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

View File

@ -81,11 +81,11 @@ if v6_use_snow_biomes then
end
local v6_freq_desert = tonumber(minetest.get_mapgen_setting("mgv6_freq_desert") or 0.45)
local NOISE_MAGIC_X = 1619
local NOISE_MAGIC_Y = 31337
local NOISE_MAGIC_Z = 52591
local NOISE_MAGIC_SEED = 1013
local noise2d = function(x, y, seed)
--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
--[[

View File

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

23
mods/CORE/controls/API.md Normal file
View File

@ -0,0 +1,23 @@
# 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,3 +1,8 @@
local get_connected_players = minetest.get_connected_players
local clock = os.clock
local pairs = pairs
controls = {}
controls.players = {}
@ -17,15 +22,15 @@ function controls.register_on_hold(func)
end
local known_controls = {
jump=true,
right=true,
left=true,
LMB=true,
RMB=true,
sneak=true,
aux1=true,
down=true,
up=true,
jump = true,
right = true,
left = true,
LMB = true,
RMB = true,
sneak = true,
aux1 = true,
down = true,
up = true,
}
minetest.register_on_joinplayer(function(player)
@ -42,31 +47,31 @@ minetest.register_on_leaveplayer(function(player)
end)
minetest.register_globalstep(function(dtime)
for _, player in pairs(minetest.get_connected_players()) do
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)
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
controls.players[player_name][cname] = {true, os.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, os.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, os.clock()-controls.players[player_name][cname][2])
end
controls.players[player_name][cname] = {false}
end
end
end
end
end
end)

View File

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

45
mods/CORE/flowlib/API.md Normal file
View File

@ -0,0 +1,45 @@
# 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,95 +1,100 @@
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)
--(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 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]}
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 is_touching = function(realpos,nodepos,radius)
local function is_touching(realpos,nodepos,radius)
local boarder = 0.5 - radius
return (math.abs(realpos - nodepos) > (boarder))
return math.abs(realpos - nodepos) > (boarder)
end
flowlib.is_touching = is_touching
local is_water = function(pos)
return (minetest.get_item_group(minetest.get_node(
{x=pos.x,y=pos.y,z=pos.z}).name
, "water") ~= 0)
local function is_water(pos)
return get_item_group(get_node(pos).name, "water") ~= 0
end
flowlib.is_water = is_water
local node_is_water = function(node)
return (minetest.get_item_group(node.name, "water") ~= 0)
local function node_is_water(node)
return get_item_group(node.name, "water") ~= 0
end
flowlib.node_is_water = node_is_water
local is_lava = function(pos)
return (minetest.get_item_group(minetest.get_node(
{x=pos.x,y=pos.y,z=pos.z}).name
, "lava") ~= 0)
local function is_lava(pos)
return get_item_group(get_node(pos).name, "lava") ~= 0
end
flowlib.is_lava = is_lava
local node_is_lava = function(node)
return (minetest.get_item_group(node.name, "lava") ~= 0)
local function node_is_lava(node)
return get_item_group(node.name, "lava") ~= 0
end
flowlib.node_is_lava = node_is_lava
local is_liquid = function(pos)
return (minetest.get_item_group(minetest.get_node(
{x=pos.x,y=pos.y,z=pos.z}).name
, "liquid") ~= 0)
local function is_liquid(pos)
return get_item_group(get_node(pos).name, "liquid") ~= 0
end
flowlib.is_liquid = is_liquid
local node_is_liquid = function(node)
return (minetest.get_item_group(node.name, "liquid") ~= 0)
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 function quick_flow_logic(node, pos_testing, direction)
local name = node.name
if not minetest.registered_nodes[name] then
if not registered_nodes[name] then
return 0
end
if minetest.registered_nodes[name].liquidtype == "source" then
local node_testing = minetest.get_node(pos_testing)
local param2_testing = node_testing.param2
if not minetest.registered_nodes[node_testing.name] then
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 minetest.registered_nodes[node_testing.name].liquidtype
~= "flowing" then
if registered_nodes[node_testing.name].liquidtype ~= "flowing" then
return 0
else
return direction
end
elseif minetest.registered_nodes[name].liquidtype == "flowing" then
local node_testing = minetest.get_node(pos_testing)
elseif registered_nodes[name].liquidtype == "flowing" then
local node_testing = get_node(pos_testing)
local param2_testing = node_testing.param2
if not minetest.registered_nodes[node_testing.name] then
if not registered_nodes[node_testing.name] then
return 0
end
if minetest.registered_nodes[node_testing.name].liquidtype
== "source" then
if registered_nodes[node_testing.name].liquidtype == "source" then
return -direction
elseif minetest.registered_nodes[node_testing.name].liquidtype
== "flowing" then
elseif registered_nodes[node_testing.name].liquidtype == "flowing" then
if param2_testing < node.param2 then
if (node.param2 - param2_testing) > 6 then
return -direction
@ -108,48 +113,41 @@ local function quick_flow_logic(node,pos_testing,direction)
return 0
end
local quick_flow = function(pos,node)
local x = 0
local z = 0
local function quick_flow(pos, node)
if not node_is_liquid(node) then
return {x=0,y=0,z=0}
return {x = 0, y = 0, z = 0}
end
x = x + quick_flow_logic(node,{x=pos.x-1,y=pos.y,z=pos.z},-1)
x = x + quick_flow_logic(node,{x=pos.x+1,y=pos.y,z=pos.z}, 1)
z = z + quick_flow_logic(node,{x=pos.x,y=pos.y,z=pos.z-1},-1)
z = z + 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})
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
--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 move_centre = function(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 = minetest.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 = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z})
pos = {x=pos.x+1,y=pos.y,z=pos.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 = minetest.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 = minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1})
pos = {x=pos.x,y=pos.y,z=pos.z+1}
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
return pos, node
end
flowlib.move_centre = move_centre

View File

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

View File

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

View File

@ -1,17 +1,21 @@
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
minetest.check_single_for_falling = function(pos)
function minetest.check_single_for_falling(pos)
local ret_o = original_function(pos)
local ret = false
local node = minetest.get_node(pos)
if minetest.get_item_group(node.name, "attached_node_facedir") ~= 0 then
local dir = minetest.facedir_to_dir(node.param2)
if get_item_group(node.name, "attached_node_facedir") ~= 0 then
local dir = facedir_to_dir(node.param2)
if dir then
local cpos = vector.add(pos, dir)
local cnode = minetest.get_node(cpos)
if minetest.get_item_group(cnode.name, "solid") == 0 then
minetest.remove_node(pos)
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])
@ -20,7 +24,6 @@ minetest.check_single_for_falling = function(pos)
end
end
end
return ret_o or ret
end

View File

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

View File

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

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

View File

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

View File

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

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

View File

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

View File

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

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

View File

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

@ -12,11 +12,23 @@ under the LGPLv2.1 license.
mcl_explosions = {}
local mod_death_messages = minetest.get_modpath("mcl_death_messages") ~= nil
local mod_fire = minetest.get_modpath("mcl_fire") ~= nil
local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire")
local mod_fire = minetest.get_modpath("mcl_fire")
--local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire")
local S = minetest.get_translator("mcl_explosions")
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 = {}
@ -32,6 +44,10 @@ 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
@ -53,46 +69,44 @@ local function compute_sphere_rays(radius)
local rays = {}
local sphere = {}
for i=1, 2 do
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, radius do
for x = -radius, 0, 1 do
local d = x * x + y * y + z * z
if d <= radius * radius then
local pos = { x = x, y = y, z = z }
sphere[minetest.hash_node_position(pos)] = pos
break
end
end
end
end
end
for i=1,2 do
for x = -radius, radius do
for z = -radius, radius do
for y = -radius, 0, 1 do
local d = x * x + y * y + z * z
if d <= radius * radius then
local pos = { x = x, y = y, z = z }
sphere[minetest.hash_node_position(pos)] = pos
break
end
end
end
end
end
for i=1,2 do
for x = -radius, radius do
for y = -radius, radius do
for z = -radius, 0, 1 do
local d = x * x + y * y + z * z
if d <= radius * radius then
local pos = { x = x, y = y, z = z }
sphere[minetest.hash_node_position(pos)] = pos
break
end
for z = -radius, 0 do
local d = x * x + y * y + z * z
if d <= radius * radius then
add_ray(vector.new(x, y, z))
add_ray(vector.new(x, y, -z))
break
end
end
end
@ -124,7 +138,7 @@ local function add_particles(pos, radius)
maxexptime = 1.0,
minsize = radius * 0.5,
maxsize = radius * 1.0,
texture = "tnt_smoke.png",
texture = "mcl_particles_smoke.png",
})
end
@ -135,15 +149,25 @@ end
-- 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 of destroyed nodes become fire
-- puncher - object that punches other objects (optional)
-- 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, drop_chance, fire, puncher, creative_enabled)
local vm = minetest.get_voxel_manip()
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))
@ -153,64 +177,75 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance, fire,
local ystride = (emax.x - emin_x + 1)
local zstride = ystride * (emax.y - emin_y + 1)
local pos_x = pos.x
local pos_y = pos.y
local pos_z = pos.z
local area = VoxelArea:new {
--[[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
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
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 idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride +
npos_x - emin_x + 1
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]
local hash = minetest.hash_node_position({x=npos_x, y=npos_y, z=npos_z})
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
rpos_x = rpos_x + STEP_LENGTH * rdir_x
rpos_y = rpos_y + STEP_LENGTH * rdir_y
rpos_z = rpos_z + STEP_LENGTH * rdir_z
local hash = hash_node_position(npos)
rstr = rstr - 0.75 * STEP_LENGTH - (br + 0.3) * STEP_LENGTH
rpos_x = rpos_x + STEP_LENGTH * rdir_x
rpos_y = rpos_y + STEP_LENGTH * rdir_y
rpos_z = rpos_z + STEP_LENGTH * rdir_z
if rstr <= 0 then
break
end
rstr = rstr - 0.75 * STEP_LENGTH - (br + 0.3) * STEP_LENGTH
if cid ~= minetest.CONTENT_AIR then
destroy[hash] = idx
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 = minetest.get_objects_inside_radius(pos, punch_radius)
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') then
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
@ -223,20 +258,20 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance, fire,
if collisionbox then
-- Create rays from random points in the collision box
local x1 = collisionbox[1] * 2
local y1 = collisionbox[2] * 2
local z1 = collisionbox[3] * 2
local x2 = collisionbox[4] * 2
local y2 = collisionbox[5] * 2
local z2 = collisionbox[6] * 2
local x1 = collisionbox[1]
local y1 = collisionbox[2]
local z1 = collisionbox[3]
local x2 = collisionbox[4]
local y2 = collisionbox[5]
local z2 = collisionbox[6]
local x_len = math.abs(x2 - x1)
local y_len = math.abs(y2 - y1)
local z_len = math.abs(z2 - z1)
-- Move object position to the center of its bounding box
opos.x = opos.x + x1 + x2
opos.y = opos.y + y1 + y2
opos.z = opos.z + z1 + z2
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
@ -284,20 +319,35 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance, fire,
impact = 0
end
local damage = math.floor((impact * impact + impact) * 7 * strength + 1)
if mod_death_messages and obj:is_player() then
mcl_death_messages.player_damage(obj, S("@1 was caught in an explosion.", obj:get_player_name()))
end
local source = puncher
if not source then
source = obj
end
obj:punch(source, 10, { damage_groups = { full_punch_interval = 1,
fleshy = damage, knockback = impact * 20.0 } }, punch_dir)
local sleep_formspec_doesnt_close_mt53 = false
if obj:is_player() then
obj:add_player_velocity(vector.multiply(punch_dir, impact * 20))
elseif ent.tnt_knockback then
obj:add_velocity(vector.multiply(punch_dir, impact * 20))
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
@ -307,57 +357,55 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance, fire,
-- Remove destroyed blocks and drop items
for hash, idx in pairs(destroy) do
local do_drop = not creative_enabled and math.random() <= drop_chance
local do_drop = math.random() <= drop_chance
local on_blast = node_on_blast[data[idx]]
local remove = true
if do_drop or on_blast ~= nil then
local npos = minetest.get_position_from_hash(hash)
if on_blast ~= nil then
on_blast(npos, 1.0)
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 = minetest.get_name_from_content_id(data[idx])
local drop = minetest.get_node_drops(name, "")
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
minetest.add_item(npos, item)
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, minetest.get_position_from_hash(hash))
table.insert(fires, get_position_from_hash(hash))
else
table.insert(airs, minetest.get_position_from_hash(hash))
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
minetest.bulk_set_node(airs, {name="air"})
bulk_set_node(airs, {name="air"})
end
if #fires > 0 then
minetest.bulk_set_node(fires, {name="mcl_fire:fire"})
bulk_set_node(fires, {name="mcl_fire:fire"})
end
-- Update falling nodes
for a=1, #airs do
local p = airs[a]
minetest.check_for_falling({x=p.x, y=p.y+1, z=p.z})
check_for_falling({x=p.x, y=p.y+1, z=p.z})
end
for f=1, #fires do
local p = fires[f]
minetest.check_for_falling({x=p.x, y=p.y+1, z=p.z})
check_for_falling({x=p.x, y=p.y+1, z=p.z})
end
-- Log explosion
minetest.log('action', 'Explosion at ' .. minetest.pos_to_string(pos) ..
' with strength ' .. strength .. ' and radius ' .. radius)
minetest.log("action", "Explosion at "..pos_to_string(pos).." with strength "..strength.." and radius "..radius)
end
-- Create an explosion with strength at pos.
@ -365,16 +413,27 @@ end
-- Parameters:
-- pos - The position where the explosion originates from
-- strength - The blast strength of the explosion (a TNT explosion uses 4)
-- info - Table containing information about explosion.
-- puncher - object that is reported as source of punches/damage (optional)
-- 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 (defaults to 1.0 / strength)
-- no_sound - If true then the explosion will not play a sound
-- no_particle - If true then the explosion will not create particles
-- 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)
function mcl_explosions.explode(pos, strength, info, puncher)
-- 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)
@ -383,13 +442,28 @@ function mcl_explosions.explode(pos, strength, info, puncher)
end
local shape = sphere_shapes[radius]
local creative_enabled = minetest.is_creative_enabled("")
trace_explode(pos, strength, shape, radius, (info and info.drop_chance) or 1 / strength, info.fire == true, puncher, creative_enabled)
-- 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
if not (info and info.no_sound) then
-- 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 not (info and info.no_particle) then
if info.sound then
minetest.sound_play("tnt_explode", {
pos = pos, gain = 1.0,
max_hear_distance = strength * 16

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,8 @@
-- 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
@ -19,12 +21,72 @@ mcl_vars.gui_bg_img = "background9[1,1;1,1;mcl_base_textures_background9.png;tru
-- 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"
if not superflat then
-- 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)
@ -45,6 +107,14 @@ if not superflat then
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")
@ -61,7 +131,7 @@ else
mcl_vars.mg_bedrock_is_rough = false
end
mcl_vars.mg_overworld_max = 31000
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
@ -108,4 +178,86 @@ 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 +1,3 @@
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 +0,0 @@
API for filling a chest with random treasures.

View File

@ -11,12 +11,15 @@ Parameters:
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)
weight = 5, -- Likelihood of this item being selected (see below). Optional (default: 1)
},
{ -- more tables like above, one table per item stack }
}
@ -37,10 +40,9 @@ function mcl_loot.get_loot(loot_definitions, pr)
total_weight = total_weight + (loot_definitions.items[i].weight or 1)
end
local stacks_min = loot_definitions.stacks_min
local stacks_max = loot_definitions.stacks_max
if not stacks_min then stacks_min = 1 end
if not stacks_max then stacks_max = 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)
@ -56,24 +58,29 @@ function mcl_loot.get_loot(loot_definitions, pr)
end
if item then
local itemstring = item.itemstring
if item.amount_min and item.amount_max then
itemstring = itemstring .. " " .. 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)
local wear = pr:next(wear_min, wear_max) * 10
if not item.amount_min and not item.amount_max then
itemstring = itemstring .. " 1"
local itemstack = item.itemstack
if itemstring then
if item.amount_min and item.amount_max then
itemstring = itemstring .. " " .. 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)
local wear = pr:next(wear_min, wear_max) * 10
itemstring = itemstring .. " " .. tostring(wear)
if not item.amount_min and not item.amount_max then
itemstring = itemstring .. " 1"
end
itemstring = itemstring .. " " .. tostring(wear)
end
table.insert(items, itemstring)
elseif itemstack then
table.insert(items, itemstack)
else
minetest.log("error", "[mcl_loot] INTERNAL ERROR! Failed to select random loot item!")
end
table.insert(items, itemstring)
else
minetest.log("error", "[mcl_loot] INTERNAL ERROR! Failed to select random loot item!")
end
end
@ -103,14 +110,14 @@ 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)
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 = math.random(1, #slots)
local r = pr and pr:next(1, #slots) or math.random(1, #slots)
table.insert(slots_out, slots[r])
table.remove(slots, r)
end
@ -127,9 +134,9 @@ 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)
function mcl_loot.fill_inventory(inv, listname, items, pr)
local size = inv:get_size(listname)
local slots = get_random_slots(size)
local slots = get_random_slots(size, pr)
local leftovers = {}
-- 1st pass: Add items into random slots
for i=1, math.min(#items, size) do

View File

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

View File

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

View File

@ -0,0 +1,131 @@
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 +1,3 @@
name = mcl_particles
author = Wuzzy
description = Contains particle images of MineClone 2. No code.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

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

View File

@ -114,9 +114,9 @@ end
function mcl_sounds.node_sound_leaves_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.35}
{name="default_grass_footstep", gain=0.1325}
table.dug = table.dug or
{name="default_grass_footstep", gain=0.85}
{name="default_grass_footstep", gain=0.425}
table.dig = table.dig or
{name="default_dig_snappy", gain=0.4}
table.place = table.place or

View File

@ -1 +1,3 @@
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.

View File

@ -1 +0,0 @@
mcl_init

View File

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

View File

@ -150,7 +150,7 @@ function mcl_util.get_eligible_transfer_item_slot(src_inventory, src_list, dst_i
end
-- Returns true if itemstack is a shulker box
local is_not_shulker_box = function(itemstack)
local function is_not_shulker_box(itemstack)
local g = minetest.get_item_group(itemstack:get_name(), "shulker_box")
return g == 0 or g == nil
end
@ -212,7 +212,7 @@ function mcl_util.move_item_container(source_pos, destination_pos, source_list,
end
-- Normalize double container by forcing to always use the left segment first
local normalize_double_container = function(pos, node, ctype)
local function normalize_double_container(pos, node, ctype)
if ctype == 6 then
pos = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right")
if not pos then
@ -395,4 +395,155 @@ function mcl_util.generate_on_place_plant_function(condition)
end
end
-- adjust the y level of an object to the center of its collisionbox
-- used to get the origin position of entity explosions
function mcl_util.get_object_center(obj)
local collisionbox = obj:get_properties().collisionbox
local pos = obj:get_pos()
local ymin = collisionbox[2]
local ymax = collisionbox[5]
pos.y = pos.y + (ymax - ymin) / 2.0
return pos
end
function mcl_util.get_color(colorstr)
local mc_color = mcl_colors[colorstr:upper()]
if mc_color then
colorstr = mc_color
elseif #colorstr ~= 7 or colorstr:sub(1, 1) ~= "#" then
return
end
local hex = tonumber(colorstr:sub(2, 7), 16)
if hex then
return colorstr, hex
end
end
function mcl_util.call_on_rightclick(itemstack, player, pointed_thing)
-- Call on_rightclick if the pointed node defines it
if pointed_thing and pointed_thing.type == "node" then
local pos = pointed_thing.under
local node = minetest.get_node(pos)
if player and not player:get_player_control().sneak then
local nodedef = minetest.registered_nodes[node.name]
local on_rightclick = nodedef and nodedef.on_rightclick
if on_rightclick then
return on_rightclick(pos, node, player, itemstack, pointed_thing) or itemstack
end
end
end
end
function mcl_util.calculate_durability(itemstack)
local unbreaking_level = mcl_enchanting.get_enchantment(itemstack, "unbreaking")
local armor_uses = minetest.get_item_group(itemstack:get_name(), "mcl_armor_uses")
local uses
if armor_uses > 0 then
uses = armor_uses
if unbreaking_level > 0 then
uses = uses / (0.6 + 0.4 / (unbreaking_level + 1))
end
else
local def = itemstack:get_definition()
if def then
local fixed_uses = def._mcl_uses
if fixed_uses then
uses = fixed_uses
if unbreaking_level > 0 then
uses = uses * (unbreaking_level + 1)
end
end
end
uses = uses or (next(itemstack:get_tool_capabilities().groupcaps) or {}).uses
end
return uses or 0
end
function mcl_util.use_item_durability(itemstack, n)
local uses = mcl_util.calculate_durability(itemstack)
itemstack:add_wear(65535 / uses * n)
end
function mcl_util.deal_damage(target, damage, mcl_reason)
local luaentity = target:get_luaentity()
if luaentity then
if luaentity.deal_damage then
luaentity:deal_damage(damage, mcl_reason or {type = "generic"})
return
elseif luaentity._cmi_is_mob then
-- local puncher = mcl_reason and mcl_reason.direct or target
-- target:punch(puncher, 1.0, {full_punch_interval = 1.0, damage_groups = {fleshy = damage}}, vector.direction(puncher:get_pos(), target:get_pos()), damage)
if luaentity.health > 0 then
luaentity.health = luaentity.health - damage
end
return
end
end
local hp = target:get_hp()
if hp > 0 then
target:set_hp(hp - damage, {_mcl_reason = mcl_reason})
end
end
function mcl_util.get_hp(obj)
local luaentity = obj:get_luaentity()
if luaentity and luaentity._cmi_is_mob then
return luaentity.health
else
return obj:get_hp()
end
end
function mcl_util.get_inventory(object, create)
if object:is_player() then
return object:get_inventory()
else
local luaentity = object:get_luaentity()
local inventory = luaentity.inventory
if create and not inventory and luaentity.create_inventory then
inventory = luaentity:create_inventory()
end
return inventory
end
end
function mcl_util.get_wielded_item(object)
if object:is_player() then
return object:get_wielded_item()
else
-- ToDo: implement getting wielditems from mobs as soon as mobs have wielditems
return ItemStack()
end
end
function mcl_util.get_object_name(object)
if object:is_player() then
return object:get_player_name()
else
local luaentity = object:get_luaentity()
if not luaentity then
return tostring(object)
end
return luaentity.nametag and luaentity.nametag ~= "" and luaentity.nametag or luaentity.description or luaentity.name
end
end
function mcl_util.replace_mob(obj, mob)
local rot = obj:get_yaw()
local pos = obj:get_pos()
obj:remove()
obj = minetest.add_entity(pos, mob)
obj:set_yaw(rot)
return obj
end

View File

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

View File

@ -0,0 +1,81 @@
# mcl_worlds
This mod provides utility functions about positions and dimensions.
## mcl_worlds.is_in_void(pos)
This function returns:
* true, true: if pos is in deep void (deadly)
* true, false: if the pos is in void (non deadly)
* false, false: owerwise
Params:
* pos: position
## mcl_worlds.y_to_layer(y)
This function is used to calculate the minetest y layer and dimension of the given <y> minecraft layer.
Mainly used for ore generation.
Takes an Y coordinate as input and returns:
* The corresponding Minecraft layer (can be nil if void)
* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if <y> is in the void
If the Y coordinate is not located in any dimension, it will return: nil, "void"
Params:
* y: int
## mcl_worlds.pos_to_dimension(pos)
This function return the Minecraft dimension of <pos> ("overworld", "nether" or "end") or "void" if <y> is in the void.
* pos: position
## mcl_worlds.layer_to_y(layer, mc_dimension)
Takes a Minecraft layer and a “dimension” name and returns the corresponding Y coordinate for MineClone 2.
mc_dimension can be "overworld", "nether", "end" (default: "overworld").
* layer: int
* mc_dimension: string
## mcl_worlds.has_weather(pos)
Returns true if <pos> can have weather, false owerwise.
Weather can be only in the overworld.
* pos: position
## mcl_worlds.has_dust(pos)
Returns true if <pos> can have nether dust, false owerwise.
Nether dust can be only in the nether.
* pos: position
## mcl_worlds.compass_works(pos)
Returns true if compasses are working at <pos>, false owerwise.
In mc, you cant use compass in the nether and the end.
* pos: position
## mcl_worlds.compass_works(pos)
Returns true if clock are working at <pos>, false owerwise.
In mc, you cant use clock in the nether and the end.
* pos: position
## mcl_worlds.register_on_dimension_change(function(player, dimension, last_dimension))
Register a callback function func(player, dimension).
It will be called whenever a player changes between dimensions.
The void counts as dimension.
* player: player, the player who changed of dimension
* dimension: string, The new dimension of the player ("overworld", "nether", "end", "void").
* last_dimension: string, The dimension where the player was ("overworld", "nether", "end", "void").
## mcl_worlds.registered_on_dimension_change
Table containing all function registered with mcl_worlds.register_on_dimension_change()
## mcl_worlds.dimension_change(player, dimension)
Notify this mod of a dimension change of <player> to <dimension>
* player: player, player who changed the dimension
* dimension: string, new dimension ("overworld", "nether", "end", "void")

View File

@ -1 +0,0 @@
mcl_init

View File

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

View File

@ -1,12 +1,14 @@
mcl_worlds = {}
local get_connected_players = minetest.get_connected_players
-- For a given position, returns a 2-tuple:
-- 1st return value: true if pos is in void
-- 2nd return value: true if it is in the deadly part of the void
function mcl_worlds.is_in_void(pos)
local void =
not ((pos.y < mcl_vars.mg_overworld_max and pos.y > mcl_vars.mg_overworld_min) or
(pos.y < mcl_vars.mg_nether_max and pos.y > mcl_vars.mg_nether_min) or
(pos.y < mcl_vars.mg_nether_max+128 and pos.y > mcl_vars.mg_nether_min) or
(pos.y < mcl_vars.mg_end_max and pos.y > mcl_vars.mg_end_min))
local void_deadly = false
@ -15,11 +17,11 @@ function mcl_worlds.is_in_void(pos)
-- Overworld → Void → End → Void → Nether → Void
if pos.y < mcl_vars.mg_overworld_min and pos.y > mcl_vars.mg_end_max then
void_deadly = pos.y < mcl_vars.mg_overworld_min - deadly_tolerance
elseif pos.y < mcl_vars.mg_end_min and pos.y > mcl_vars.mg_nether_max then
elseif pos.y < mcl_vars.mg_end_min and pos.y > mcl_vars.mg_nether_max+128 then
-- The void between End and Nether. Like usual, but here, the void
-- *above* the Nether also has a small tolerance area, so player
-- can fly above the Nether without getting hurt instantly.
void_deadly = (pos.y < mcl_vars.mg_end_min - deadly_tolerance) and (pos.y > mcl_vars.mg_nether_max + deadly_tolerance)
void_deadly = (pos.y < mcl_vars.mg_end_min - deadly_tolerance) and (pos.y > mcl_vars.mg_nether_max+128 + deadly_tolerance)
elseif pos.y < mcl_vars.mg_nether_min then
void_deadly = pos.y < mcl_vars.mg_nether_min - deadly_tolerance
end
@ -33,54 +35,64 @@ end
-- If the Y coordinate is not located in any dimension, it will return:
-- nil, "void"
function mcl_worlds.y_to_layer(y)
if y >= mcl_vars.mg_overworld_min then
return y - mcl_vars.mg_overworld_min, "overworld"
elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max then
return y - mcl_vars.mg_nether_min, "nether"
elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then
return y - mcl_vars.mg_end_min, "end"
else
return nil, "void"
end
if y >= mcl_vars.mg_overworld_min then
return y - mcl_vars.mg_overworld_min, "overworld"
elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max+128 then
return y - mcl_vars.mg_nether_min, "nether"
elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then
return y - mcl_vars.mg_end_min, "end"
else
return nil, "void"
end
end
local y_to_layer = mcl_worlds.y_to_layer
-- Takes a pos and returns the dimension it belongs to (same as above)
function mcl_worlds.pos_to_dimension(pos)
local _, dim = mcl_worlds.y_to_layer(pos.y)
local _, dim = y_to_layer(pos.y)
return dim
end
local pos_to_dimension = mcl_worlds.pos_to_dimension
-- Takes a Minecraft layer and a “dimension” name
-- and returns the corresponding Y coordinate for
-- MineClone 2.
-- mc_dimension is one of "overworld", "nether", "end" (default: "overworld").
function mcl_worlds.layer_to_y(layer, mc_dimension)
if mc_dimension == "overworld" or mc_dimension == nil then
return layer + mcl_vars.mg_overworld_min
elseif mc_dimension == "nether" then
return layer + mcl_vars.mg_nether_min
elseif mc_dimension == "end" then
return layer + mcl_vars.mg_end_min
end
if mc_dimension == "overworld" or mc_dimension == nil then
return layer + mcl_vars.mg_overworld_min
elseif mc_dimension == "nether" then
return layer + mcl_vars.mg_nether_min
elseif mc_dimension == "end" then
return layer + mcl_vars.mg_end_min
end
end
-- Takes a position and returns true if this position can have weather
function mcl_worlds.has_weather(pos)
-- Weather in the Overworld and the high part of the void below
return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64
-- Weather in the Overworld and the high part of the void below
return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64
end
-- Takes a position and returns true if this position can have Nether dust
function mcl_worlds.has_dust(pos)
-- Weather in the Overworld and the high part of the void below
return pos.y <= mcl_vars.mg_nether_max + 138 and pos.y >= mcl_vars.mg_nether_min - 10
end
-- Takes a position (pos) and returns true if compasses are working here
function mcl_worlds.compass_works(pos)
-- It doesn't work in Nether and the End, but it works in the Overworld and in the high part of the void below
local _, dim = mcl_worlds.y_to_layer(pos.y)
if dim == "nether" or dim == "end" then
return false
elseif dim == "void" then
return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64
else
return true
end
-- It doesn't work in Nether and the End, but it works in the Overworld and in the high part of the void below
local _, dim = mcl_worlds.y_to_layer(pos.y)
if dim == "nether" or dim == "end" then
return false
elseif dim == "void" then
return pos.y <= mcl_vars.mg_overworld_max and pos.y >= mcl_vars.mg_overworld_min - 64
else
return true
end
end
-- Takes a position (pos) and returns true if clocks are working here
@ -106,12 +118,15 @@ local last_dimension = {}
-- * player: Player who changed the dimension
-- * dimension: New dimension ("overworld", "nether", "end", "void")
function mcl_worlds.dimension_change(player, dimension)
local playername = player:get_player_name()
for i=1, #mcl_worlds.registered_on_dimension_change do
mcl_worlds.registered_on_dimension_change[i](player, dimension)
last_dimension[player:get_player_name()] = dimension
mcl_worlds.registered_on_dimension_change[i](player, dimension, last_dimension[playername])
end
last_dimension[playername] = dimension
end
local dimension_change = mcl_worlds.dimension_change
----------------------- INTERNAL STUFF ----------------------
-- Update the dimension callbacks every DIM_UPDATE seconds
@ -119,19 +134,19 @@ local DIM_UPDATE = 1
local dimtimer = 0
minetest.register_on_joinplayer(function(player)
last_dimension[player:get_player_name()] = mcl_worlds.pos_to_dimension(player:get_pos())
last_dimension[player:get_player_name()] = pos_to_dimension(player:get_pos())
end)
minetest.register_globalstep(function(dtime)
-- regular updates based on iterval
dimtimer = dimtimer + dtime;
if dimtimer >= DIM_UPDATE then
local players = minetest.get_connected_players()
for p=1, #players do
local dim = mcl_worlds.pos_to_dimension(players[p]:get_pos())
local players = get_connected_players()
for p = 1, #players do
local dim = pos_to_dimension(players[p]:get_pos())
local name = players[p]:get_player_name()
if dim ~= last_dimension[name] then
mcl_worlds.dimension_change(players[p], dim)
dimension_change(players[p], dim)
end
end
dimtimer = 0

View File

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

View File

@ -0,0 +1,4 @@
# tga_encoder
A TGA Encoder written in Lua without the use of external Libraries.
May be used as a Minetest mod.

View File

@ -0,0 +1,78 @@
tga_encoder = {}
local image = setmetatable({}, {
__call = function(self, ...)
local t = setmetatable({}, {__index = self})
t:constructor(...)
return t
end,
})
function image:constructor(pixels)
self.data = ""
self.pixels = pixels
self.width = #pixels[1]
self.height = #pixels
self:encode()
end
function image:encode_colormap_spec()
self.data = self.data
.. string.char(0, 0) -- first entry index
.. string.char(0, 0) -- number of entries
.. string.char(0) -- bits per pixel
end
function image:encode_image_spec()
self.data = self.data
.. string.char(0, 0) -- X-origin
.. string.char(0, 0) -- Y-origin
.. string.char(self.width % 256, math.floor(self.width / 256)) -- width
.. string.char(self.height % 256, math.floor(self.height / 256)) -- height
.. string.char(24) -- pixel depth (RGB = 3 bytes = 24 bits)
.. string.char(0) -- image descriptor
end
function image:encode_header()
self.data = self.data
.. string.char(0) -- image id
.. string.char(0) -- color map type
.. string.char(2) -- image type (uncompressed true-color image = 2)
self:encode_colormap_spec() -- color map specification
self:encode_image_spec() -- image specification
end
function image:encode_data()
for _, row in ipairs(self.pixels) do
for _, pixel in ipairs(row) do
self.data = self.data
.. string.char(pixel[3], pixel[2], pixel[1])
end
end
end
function image:encode_footer()
self.data = self.data
.. string.char(0, 0, 0, 0) -- extension area offset
.. string.char(0, 0, 0, 0) -- developer area offset
.. "TRUEVISION-XFILE"
.. "."
.. string.char(0)
end
function image:encode()
self:encode_header() -- header
-- no color map and image id data
self:encode_data() -- encode data
-- no extension or developer area
self:encode_footer() -- footer
end
function image:save(filename)
local f = assert(io.open(filename, "w"))
f:write(self.data)
f:close()
end
tga_encoder.image = image

View File

@ -0,0 +1,3 @@
name = tga_encoder
author = Fleckenstein
description = A TGA Encoder written in Lua without the use of external Libraries.

View File

@ -1,24 +1,52 @@
-- register extra flavours of a base nodedef
local get_connected_players = minetest.get_connected_players
local get_node = minetest.get_node
local vector_add = vector.add
local ceil = math.ceil
local pairs = pairs
walkover = {}
walkover.registered_globals = {}
function walkover.register_global(func)
table.insert(walkover.registered_globals, func)
end
local on_walk = {}
local registered_globals = {}
minetest.register_on_mods_loaded(function()
for name,def in pairs(minetest.registered_nodes) do
if def.on_walk_over then
on_walk[name] = def.on_walk_over
end
end
for _,func in ipairs(walkover.registered_globals) do --cache registered globals
table.insert(registered_globals, func)
end
end)
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime;
if timer >= 0.3 then
for _,player in pairs(minetest.get_connected_players()) do
local pp = player:get_pos()
pp.y = math.ceil(pp.y)
local loc = vector.add(pp, {x=0,y=-1,z=0})
if loc ~= nil then
local nodeiamon = minetest.get_node(loc)
if nodeiamon ~= nil then
local def = minetest.registered_nodes[nodeiamon.name]
if def ~= nil and def.on_walk_over ~= nil then
def.on_walk_over(loc, nodeiamon, player)
end
end
end
end
for _,player in pairs(get_connected_players()) do
local pp = player:get_pos()
pp.y = ceil(pp.y)
local loc = vector_add(pp, {x=0,y=-1,z=0})
if loc then
local nodeiamon = get_node(loc)
if nodeiamon then
if on_walk[nodeiamon.name] then
on_walk[nodeiamon.name](loc, nodeiamon, player)
end
for i = 1, #registered_globals do
registered_globals[i](loc, nodeiamon, player)
end
end
end
end
timer = 0
end
end)

View File

@ -0,0 +1,4 @@
name = walkover
author = lordfingle
description = Some mode developers have shown an interest in having an `on_walk_over` event. This is useful for pressure-plates and the like.

View File

@ -1 +0,0 @@
mcl_core

View File

@ -1,6 +1,8 @@
--Dripping Water Mod
--by kddekadenz
local math = math
-- License of code, textures & sounds: CC0
--Drop entities
@ -20,26 +22,21 @@ minetest.register_entity("drippingwater:drop_water", {
spritediv = {x=1, y=1},
initial_sprite_basepos = {x=0, y=0},
static_save = false,
on_activate = function(self, staticdata)
self.object:set_sprite({x=0,y=0}, 1, 1, true)
end,
on_step = function(self, dtime)
local k = math.random(1,222)
local ownpos = self.object:get_pos()
if k==1 then
self.object:set_acceleration({x=0, y=-5, z=0})
end
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
self.object:set_acceleration({x=0, y=-5, z=0})
end
local k = math.random(1,222)
local ownpos = self.object:get_pos()
if k==1 then
self.object:set_acceleration({x=0, y=-5, z=0})
end
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
self.object:set_acceleration({x=0, y=-5, z=0})
end
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
self.object:remove()
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
self.object:remove()
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
end
end,
})
@ -61,27 +58,21 @@ minetest.register_entity("drippingwater:drop_lava", {
spritediv = {x=1, y=1},
initial_sprite_basepos = {x=0, y=0},
static_save = false,
on_activate = function(self, staticdata)
self.object:set_sprite({x=0,y=0}, 1, 0, true)
end,
on_step = function(self, dtime)
local k = math.random(1,222)
local ownpos = self.object:get_pos()
if k==1 then
self.object:set_acceleration({x=0, y=-5, z=0})
end
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
self.object:set_acceleration({x=0, y=-5, z=0})
end
local k = math.random(1,222)
local ownpos = self.object:get_pos()
if k == 1 then
self.object:set_acceleration({x=0, y=-5, z=0})
end
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
self.object:set_acceleration({x=0, y=-5, z=0})
end
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
self.object:remove()
minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
self.object:remove()
minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
end
end,
})
@ -90,36 +81,34 @@ minetest.register_entity("drippingwater:drop_lava", {
--Create drop
minetest.register_abm(
{
minetest.register_abm({
label = "Create water drops",
nodenames = {"group:opaque", "group:leaves"},
neighbors = {"group:water"},
interval = 2,
chance = 22,
action = function(pos)
if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "water") ~= 0 and
minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then
interval = 2,
chance = 22,
action = function(pos)
if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "water") ~= 0
and minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then
local i = math.random(-45,45) / 100
minetest.add_entity({x=pos.x + i, y=pos.y - 0.501, z=pos.z + i}, "drippingwater:drop_water")
end
end,
end,
})
--Create lava drop
minetest.register_abm(
{
minetest.register_abm({
label = "Create lava drops",
nodenames = {"group:opaque"},
neighbors = {"group:lava"},
interval = 2,
chance = 22,
action = function(pos)
if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "lava") ~= 0 and
minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then
interval = 2,
chance = 22,
action = function(pos)
if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name, "lava") ~= 0
and minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then
local i = math.random(-45,45) / 100
minetest.add_entity({x=pos.x + i, y=pos.y - 0.501, z=pos.z + i}, "drippingwater:drop_lava")
end
end,
})
end,
})

View File

@ -0,0 +1,4 @@
name = drippingwater
author = kddekadenz
description = Drops are generated rarely under solid nodes
depends = mcl_core

View File

@ -20,4 +20,4 @@ Authors include:
* Various Minetest / Minetest Game developers and contributors (2012-2016)
* maikerumine (2017)
* Wuzzy (2017)
* Fleckenstein (2020-2021)

View File

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

View File

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

View File

@ -1,13 +1,22 @@
local S = minetest.get_translator("mcl_boats")
--
-- Helper functions
--
local S = minetest.get_translator(minetest.get_current_modname())
local function is_water(pos)
local boat_visual_size = {x = 1, y = 1, z = 1}
local paddling_speed = 22
local boat_y_offset = 0.35
local boat_y_offset_ground = boat_y_offset + 0.6
local boat_side_offset = 1.001
local boat_max_hp = 4
local function is_group(pos, group)
local nn = minetest.get_node(pos).name
return minetest.get_item_group(nn, "water") ~= 0
return minetest.get_item_group(nn, group) ~= 0
end
local is_water = flowlib.is_water
local function is_ice(pos)
return is_group(pos, "ice")
end
local function get_sign(i)
if i == 0 then
@ -17,25 +26,83 @@ local function get_sign(i)
end
end
local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v
return {x = x, y = y, z = z}
end
local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2)
end
local boat_visual_size = {x = 3, y = 3}
-- Note: This mod assumes the default player visual_size is {x=1, y=1}
local driver_visual_size = { x = 1/boat_visual_size.x, y = 1/boat_visual_size.y }
local paddling_speed = 22
local boat_y_offset = 0.35
local boat_y_offset_ground = boat_y_offset + 0.6
local boat_side_offset = 1.001
local function check_object(obj)
return obj and (obj:is_player() or obj:get_luaentity()) and obj
end
local function get_visual_size(obj)
return obj:is_player() and {x = 1, y = 1, z = 1} or obj:get_luaentity()._old_visual_size or obj:get_properties().visual_size
end
local function set_attach(boat)
boat._driver:set_attach(boat.object, "",
{x = 0, y = 0.42, z = -1}, {x = 0, y = 0, z = 0})
end
local function set_double_attach(boat)
boat._driver:set_attach(boat.object, "",
{x = 0, y = 0.42, z = 0.8}, {x = 0, y = 0, z = 0})
boat._passenger:set_attach(boat.object, "",
{x = 0, y = 0.42, z = -2.2}, {x = 0, y = 0, z = 0})
end
local function attach_object(self, obj)
if self._driver then
if self._driver:is_player() then
self._passenger = obj
else
self._passenger = self._driver
self._driver = obj
end
set_double_attach(self)
else
self._driver = obj
set_attach(self)
end
local visual_size = get_visual_size(obj)
local yaw = self.object:get_yaw()
obj:set_properties({visual_size = vector.divide(visual_size, boat_visual_size)})
if obj:is_player() then
local name = obj:get_player_name()
mcl_player.player_attached[name] = true
minetest.after(0.2, function(name)
local player = minetest.get_player_by_name(name)
if player then
mcl_player.player_set_animation(player, "sit" , 30)
end
end, name)
obj:set_look_horizontal(yaw)
mcl_title.set(obj, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60})
else
obj:get_luaentity()._old_visual_size = visual_size
end
end
local function detach_object(obj, change_pos)
obj:set_detach()
obj:set_properties({visual_size = get_visual_size(obj)})
if obj:is_player() then
mcl_player.player_attached[obj:get_player_name()] = false
mcl_player.player_set_animation(obj, "stand" , 30)
else
obj:get_luaentity()._old_visual_size = nil
end
if change_pos then
obj:set_pos(vector.add(obj:get_pos(), vector.new(0, 0.2, 0)))
end
end
--
-- Boat entity
@ -50,67 +117,41 @@ local boat = {
mesh = "mcl_boats_boat.b3d",
textures = {"mcl_boats_texture_oak_boat.png"},
visual_size = boat_visual_size,
hp_max = boat_max_hp,
damage_texture_modifier = "^[colorize:white:0",
_driver = nil, -- Attached driver (player) or nil if none
_passenger = nil,
_v = 0, -- Speed
_last_v = 0, -- Temporary speed variable
_removed = false, -- If true, boat entity is considered removed (e.g. after punch) and should be ignored
_itemstring = "mcl_boats:boat", -- Itemstring of the boat item (implies boat type)
_animation = 0, -- 0: not animated; 1: paddling forwards; -1: paddling forwards
_regen_timer = 0,
_damage_anim = 0,
}
minetest.register_on_respawnplayer(detach_object)
function boat.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then
if self._passenger or not clicker or clicker:get_attach() then
return
end
local name = clicker:get_player_name()
if self._driver and clicker == self._driver then
self._driver = nil
clicker:set_detach()
clicker:set_properties({visual_size = {x=1, y=1}})
mcl_player.player_attached[name] = false
mcl_player.player_set_animation(clicker, "stand" , 30)
local pos = clicker:get_pos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
clicker:set_pos(pos)
elseif not self._driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity._driver then
luaentity._driver = nil
end
clicker:set_detach()
clicker:set_properties({visual_size = {x=1, y=1}})
end
self._driver = clicker
clicker:set_attach(self.object, "",
{x = 0, y = 0.42, z = -1}, {x = 0, y = 0, z = 0})
clicker:set_properties({ visual_size = driver_visual_size })
mcl_player.player_attached[name] = true
minetest.after(0.2, function(name)
local player = minetest.get_player_by_name(name)
if player then
mcl_player.player_set_animation(player, "sit" , 30)
end
end, name)
clicker:set_look_horizontal(self.object:get_yaw())
end
attach_object(self, clicker)
end
function boat.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1})
self.object:set_armor_groups({fleshy = 100})
local data = minetest.deserialize(staticdata)
if type(data) == "table" then
self._v = data.v
self._last_v = self._v
self._itemstring = data.itemstring
self.object:set_properties({textures=data.textures})
self.object:set_properties({textures = data.textures})
end
end
function boat.get_staticdata(self)
return minetest.serialize({
v = self._v,
@ -119,52 +160,107 @@ function boat.get_staticdata(self)
})
end
function boat.on_death(self, killer)
mcl_burning.extinguish(self.object)
function boat.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self._removed then
return
end
if self._driver and puncher == self._driver then
self._driver = nil
puncher:set_detach()
puncher:set_properties({visual_size = {x=1, y=1}})
mcl_player.player_attached[puncher:get_player_name()] = false
end
if not self._driver then
self._removed = true
-- Drop boat as item on the ground after punching
if not minetest.is_creative_enabled(puncher:get_player_name()) then
minetest.add_item(self.object:get_pos(), self._itemstring)
else
local inv = puncher:get_inventory()
if not inv:contains_item("main", self._itemstring) then
inv:add_item("main", self._itemstring)
end
if killer and killer:is_player() and minetest.is_creative_enabled(killer:get_player_name()) then
local inv = killer:get_inventory()
if not inv:contains_item("main", self._itemstring) then
inv:add_item("main", self._itemstring)
end
self.object:remove()
else
minetest.add_item(self.object:get_pos(), self._itemstring)
end
if self._driver then
detach_object(self._driver)
end
if self._passenger then
detach_object(self._passenger)
end
self._driver = nil
self._passenger = nil
end
function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)
if damage > 0 then
self._regen_timer = 0
end
end
function boat.on_step(self, dtime)
function boat.on_step(self, dtime, moveresult)
mcl_burning.tick(self.object, dtime, self)
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
local on_water = true
local in_water = false
local v_factor = 1
local v_slowdown = 0.02
local p = self.object:get_pos()
if (not is_water({x=p.x, y=p.y-boat_y_offset, z=p.z})) then
local on_water = true
local on_ice = false
local in_water = is_water({x=p.x, y=p.y-boat_y_offset+1, z=p.z})
local waterp = {x=p.x, y=p.y-boat_y_offset - 0.1, z=p.z}
if not is_water(waterp) then
on_water = false
v_factor = 0.5
v_slowdown = 0.04
elseif (is_water({x=p.x, y=p.y-boat_y_offset+1, z=p.z})) then
if not in_water and is_ice(waterp) then
on_ice = true
else
v_slowdown = 0.04
v_factor = 0.5
end
elseif in_water then
on_water = false
in_water = true
v_factor = 0.75
v_slowdown = 0.05
end
local hp = self.object:get_hp()
local regen_timer = self._regen_timer + dtime
if hp >= boat_max_hp then
regen_timer = 0
elseif regen_timer >= 0.5 then
hp = hp + 1
self.object:set_hp(hp)
regen_timer = 0
end
self._regen_timer = regen_timer
if moveresult and moveresult.collides then
for _, collision in pairs(moveresult.collisions) do
local pos = collision.node_pos
if collision.type == "node" and minetest.get_item_group(minetest.get_node(pos).name, "dig_by_boat") > 0 then
minetest.dig_node(pos)
end
end
end
local had_passenger = self._passenger
self._driver = check_object(self._driver)
self._passenger = check_object(self._passenger)
if self._passenger then
if not self._driver then
self._driver = self._passenger
self._passenger = nil
else
local ctrl = self._passenger:get_player_control()
if ctrl and ctrl.sneak then
detach_object(self._passenger, true)
self._passenger = nil
end
end
end
if self._driver then
if had_passenger and not self._passenger then
set_attach(self)
end
local ctrl = self._driver:get_player_control()
if ctrl and ctrl.sneak then
detach_object(self._driver, true)
self._driver = nil
return
end
local yaw = self.object:get_yaw()
if ctrl.up then
-- Forwards
@ -191,13 +287,13 @@ function boat.on_step(self, dtime)
self._animation = 0
end
end
if ctrl.left then
if ctrl and ctrl.left then
if self._v < 0 then
self.object:set_yaw(yaw - (1 + dtime) * 0.03 * v_factor)
else
self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor)
end
elseif ctrl.right then
elseif ctrl and ctrl.right then
if self._v < 0 then
self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor)
else
@ -210,11 +306,19 @@ function boat.on_step(self, dtime)
self.object:set_animation({x=0, y=40}, 0, 0, true)
self._animation = 0
end
for _, obj in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 1.3)) do
local entity = obj:get_luaentity()
if entity and entity._cmi_is_mob then
attach_object(self, obj)
break
end
end
end
local s = get_sign(self._v)
if not on_water and not in_water and math.abs(self._v) > 1.0 then
v_slowdown = math.min(math.abs(self._v) - 1.0, v_slowdown * 5)
elseif in_water and math.abs(self._v) > 1.5 then
if not on_ice and not on_water and not in_water and math.abs(self._v) > 2.0 then
v_slowdown = math.min(math.abs(self._v) - 2.0, v_slowdown * 5)
elseif not on_ice and in_water and math.abs(self._v) > 1.5 then
v_slowdown = math.min(math.abs(self._v) - 1.5, v_slowdown * 5)
end
self._v = self._v - v_slowdown * s
@ -224,10 +328,10 @@ function boat.on_step(self, dtime)
p.y = p.y - boat_y_offset
local new_velo
local new_acce = {x = 0, y = 0, z = 0}
if not is_water(p) then
local new_acce
if not is_water(p) and not on_ice then
-- Not on water or inside water: Free fall
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
--local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
new_acce = {x = 0, y = -9.8, z = 0}
new_velo = get_velocity(self._v, self.object:get_yaw(),
self.object:get_velocity().y)
@ -255,12 +359,17 @@ function boat.on_step(self, dtime)
end
-- Terminal velocity: 8 m/s per axis of travel
local terminal_velocity = on_ice and 57.1 or 8.0
for _,axis in pairs({"z","y","x"}) do
if math.abs(new_velo[axis]) > 8 then
new_velo[axis] = 8 * get_sign(new_velo[axis])
if math.abs(new_velo[axis]) > terminal_velocity then
new_velo[axis] = terminal_velocity * get_sign(new_velo[axis])
end
end
local yaw = self.object:get_yaw()
local anim = (boat_max_hp - hp - regen_timer * 2) / boat_max_hp * math.pi / 4
self.object:set_rotation(vector.new(anim, yaw, anim))
self.object:set_velocity(new_velo)
self.object:set_acceleration(new_acce)
end
@ -285,7 +394,7 @@ for b=1, #boat_ids do
if b == 1 then
help = true
longdesc = S("Boats are used to travel on the surface of water.")
usagehelp = S("Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.")
usagehelp = S("Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.")
helpname = S("Boat")
end
tt_help = S("Water vehicle")
@ -361,6 +470,6 @@ minetest.register_craft({
burntime = 20,
})
if minetest.get_modpath("doc_identifier") ~= nil then
if minetest.get_modpath("doc_identifier") then
doc.sub.identifier.register_object("mcl_boats:boat", "craftitems", "mcl_boats:boat")
end

View File

@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=Boote werden benutzt, um sich
Dark Oak Boat=Schwarzeichenboot
Jungle Boat=Dschungelboot
Oak Boat=Eichenboot
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Rechtsklicken Sie auf eine Wasserquelle, um das Boot zu platzieren. Rechtsklicken Sie auf das Boot, um es zu betreten. Mit [Links] und [Rechts] lenken, mit [Vorwärts] und [Rückwärts] Geschwindigkeit regeln oder rückwärts fahren. Rechtsklicken Sie erneut auf das Boot, um es zu verlassen, schlagen Sie das Boot, um es als Gegenstand fallen zu lassen.
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Rechtsklicken Sie auf eine Wasserquelle, um das Boot zu platzieren. Rechtsklicken Sie auf das Boot, um es zu betreten. Mit [Links] und [Rechts] lenken, mit [Vorwärts] und [Rückwärts] Geschwindigkeit regeln oder rückwärts fahren. Nutzen sie [Schleichen], um das Boot zu verlassen, schlagen Sie das Boot, um es als Gegenstand fallen zu lassen.
Spruce Boat=Fichtenboot
Water vehicle=Wasserfahrzeug
Sneak to dismount=Zum Aussteigen schleichen

View File

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

View File

@ -0,0 +1,12 @@
# textdomain: mcl_boats
Acacia Boat=Akacjowa łódź
Birch Boat=Brzozowa łódź
Boat=Łódź
Boats are used to travel on the surface of water.=Łodzie są wykorzystywane do podróżowania po powierzchni wody.
Dark Oak Boat=Ciemno-dębowa łódź
Jungle Boat=Tropikalna łódź
Oak Boat=Dębowa łódź
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Kliknij prawym przyciskiem myszy na źródło wody by postawić łódź. Kliknij prawym przyciskiem myszy by w nią wsiąść. Użyj przycisków [Lewy] oraz [Prawy] by sterować, [Naprzód] by przyspieszyć i [W tył] by zwolnić lub się cofać. Kliknij [Skradanie] by z niej wyjść, uderz ją by wziąć ją jako przedmiot.
Spruce Boat=Świerkowa łódź
Water vehicle=Pojazd wodny
Sneak to dismount=Skradaj się by opuścić łódź

View File

@ -0,0 +1,11 @@
# textdomain: mcl_boats
Acacia Boat=Лодка из акации
Birch Boat=Берёзовая лодка
Boat=Лодка
Boats are used to travel on the surface of water.=С помощью лодки можно путешествовать по водной поверхности.
Dark Oak Boat=Лодка из тёмного дуба
Jungle Boat=Лодка из дерева джунглей
Oak Boat=Дубовая лодка
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Правый клик по воде спустит лодку на воду. Правый клик по лодке разместит вас в ней. [Влево] и [Вправо] - рулить, [Вперед] - разгоняться, [Назад] - тормозить или плыть назад. Правый клик по лодке, когда вы в ней, позволит выйти из неё. Удар по лодке превратит её обратно в предмет.
Spruce Boat=Еловая лодка
Water vehicle=Водный транспорт

View File

@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=
Dark Oak Boat=
Jungle Boat=
Oak Boat=
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=
Spruce Boat=
Water vehicle=
Sneak to dismount=

View File

@ -1 +1,7 @@
name = mcl_boats
author = PilzAdam
description = Adds drivable boats.
depends = mcl_player, flowlib, mcl_title
optional_depends = mcl_core, doc_identifier

View File

@ -0,0 +1,138 @@
function mcl_burning.get_storage(obj)
return obj:is_player() and mcl_burning.storage[obj] or obj:get_luaentity()
end
function mcl_burning.is_burning(obj)
return mcl_burning.get_storage(obj).burn_time
end
function mcl_burning.is_affected_by_rain(obj)
return mcl_weather.get_weather() == "rain" and mcl_weather.is_outdoor(obj:get_pos())
end
function mcl_burning.get_collisionbox(obj, smaller, storage)
local cache = storage.collisionbox_cache
if cache then
local box = cache[smaller and 2 or 1]
return box[1], box[2]
else
local box = obj:get_properties().collisionbox
local minp, maxp = vector.new(box[1], box[2], box[3]), vector.new(box[4], box[5], box[6])
local s_vec = vector.new(0.1, 0.1, 0.1)
local s_minp = vector.add(minp, s_vec)
local s_maxp = vector.subtract(maxp, s_vec)
storage.collisionbox_cache = {{minp, maxp}, {s_minp, s_maxp}}
return minp, maxp
end
end
function mcl_burning.get_touching_nodes(obj, nodenames, storage)
local pos = obj:get_pos()
local minp, maxp = mcl_burning.get_collisionbox(obj, true, storage)
local nodes = minetest.find_nodes_in_area(vector.add(pos, minp), vector.add(pos, maxp), nodenames)
return nodes
end
function mcl_burning.set_on_fire(obj, burn_time)
if obj:get_hp() < 0 then
return
end
local storage = mcl_burning.get_storage(obj)
local luaentity = obj:get_luaentity()
if luaentity and luaentity.fire_resistant then
return
end
if obj:is_player() and minetest.is_creative_enabled(obj:get_player_name()) then
burn_time = 0
else
local max_fire_prot_lvl = 0
local inv = mcl_util.get_inventory(obj)
local armor_list = inv and inv:get_list("armor")
if armor_list then
for _, stack in pairs(armor_list) do
local fire_prot_lvl = mcl_enchanting.get_enchantment(stack, "fire_protection")
if fire_prot_lvl > max_fire_prot_lvl then
max_fire_prot_lvl = fire_prot_lvl
end
end
end
if max_fire_prot_lvl > 0 then
burn_time = burn_time - math.floor(burn_time * max_fire_prot_lvl * 0.15)
end
end
if not storage.burn_time or burn_time >= storage.burn_time then
if obj:is_player() then
mcl_burning.channels[obj]:send_all(tostring(mcl_burning.animation_frames))
mcl_burning.channels[obj]:send_all("start")
end
storage.burn_time = burn_time
storage.fire_damage_timer = 0
local fire_entity = minetest.add_entity(obj:get_pos(), "mcl_burning:fire")
local minp, maxp = mcl_burning.get_collisionbox(obj, false, storage)
local obj_size = obj:get_properties().visual_size
local vertical_grow_factor = 1.2
local horizontal_grow_factor = 1.1
local grow_vector = vector.new(horizontal_grow_factor, vertical_grow_factor, horizontal_grow_factor)
local size = vector.subtract(maxp, minp)
size = vector.multiply(size, grow_vector)
size = vector.divide(size, obj_size)
local offset = vector.new(0, size.y * 10 / 2, 0)
fire_entity:set_properties({visual_size = size})
fire_entity:set_attach(obj, "", offset, {x = 0, y = 0, z = 0})
local fire_luaentity = fire_entity:get_luaentity()
for _, other in pairs(minetest.get_objects_inside_radius(fire_entity:get_pos(), 0)) do
local other_luaentity = other:get_luaentity()
if other_luaentity and other_luaentity.name == "mcl_burning:fire" and other_luaentity ~= fire_luaentity then
other:remove()
break
end
end
end
end
function mcl_burning.extinguish(obj)
if mcl_burning.is_burning(obj) then
local storage = mcl_burning.get_storage(obj)
if obj:is_player() then
mcl_burning.channels[obj]:send_all("stop")
mcl_burning.storage[obj] = {}
else
storage.burn_time = nil
storage.fire_damage_timer = nil
end
end
end
function mcl_burning.tick(obj, dtime, storage)
if storage.burn_time then
storage.burn_time = storage.burn_time - dtime
if storage.burn_time <= 0 or mcl_burning.is_affected_by_rain(obj) or #mcl_burning.get_touching_nodes(obj, "group:puts_out_fire", storage) > 0 then
mcl_burning.extinguish(obj)
return true
else
storage.fire_damage_timer = storage.fire_damage_timer + dtime
if storage.fire_damage_timer >= 1 then
storage.fire_damage_timer = 0
local luaentity = obj:get_luaentity()
if not luaentity or not luaentity.fire_damage_resistant then
mcl_util.deal_damage(obj, 1, {type = "on_fire"})
end
end
end
end
end

View File

@ -0,0 +1,111 @@
local modpath = minetest.get_modpath(minetest.get_current_modname())
local pairs = pairs
local get_connected_players = minetest.get_connected_players
local get_item_group = minetest.get_item_group
mcl_burning = {
storage = {},
channels = {},
animation_frames = tonumber(minetest.settings:get("fire_animation_frames")) or 8
}
dofile(modpath .. "/api.lua")
minetest.register_globalstep(function(dtime)
for _, player in pairs(get_connected_players()) do
local storage = mcl_burning.storage[player]
if not mcl_burning.tick(player, dtime, storage) and not mcl_burning.is_affected_by_rain(player) then
local nodes = mcl_burning.get_touching_nodes(player, {"group:puts_out_fire", "group:set_on_fire"}, storage)
local burn_time = 0
for _, pos in pairs(nodes) do
local node = minetest.get_node(pos)
if get_item_group(node.name, "puts_out_fire") > 0 then
burn_time = 0
break
end
local value = get_item_group(node.name, "set_on_fire")
if value > burn_time then
burn_time = value
end
end
if burn_time > 0 then
mcl_burning.set_on_fire(player, burn_time)
end
end
end
end)
minetest.register_on_respawnplayer(function(player)
mcl_burning.extinguish(player)
end)
minetest.register_on_joinplayer(function(player)
local storage
local burn_data = player:get_meta():get_string("mcl_burning:data")
if burn_data == "" then
storage = {}
else
storage = minetest.deserialize(burn_data)
end
mcl_burning.storage[player] = storage
mcl_burning.channels[player] = minetest.mod_channel_join("mcl_burning:" .. player:get_player_name())
end)
minetest.register_on_leaveplayer(function(player)
player:get_meta():set_string("mcl_burning:data", minetest.serialize(mcl_burning.storage[player]))
mcl_burning.storage[player] = nil
end)
minetest.register_entity("mcl_burning:fire", {
initial_properties = {
physical = false,
collisionbox = {0, 0, 0, 0, 0, 0},
visual = "upright_sprite",
textures = {
name = "mcl_burning_entity_flame_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.0,
},
},
spritediv = {x = 1, y = mcl_burning.animation_frames},
pointable = false,
glow = -1,
backface_culling = false,
},
animation_frame = 0,
animation_timer = 0,
on_activate = function(self)
self.object:set_sprite({x = 0, y = 0}, mcl_burning.animation_frames, 1.0 / mcl_burning.animation_frames)
end,
on_step = function(self)
if not self:sanity_check() then
self.object:remove()
end
end,
sanity_check = function(self)
local parent = self.object:get_attach()
if not parent then
return false
end
local storage = mcl_burning.get_storage(parent)
if not storage or not storage.burn_time then
return false
end
return true
end,
})

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