diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 000000000..556b2e8f0 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,43 @@ +unused_args = false +allow_defined_top = true +max_line_length = false +redefined = false + +globals = { + "minetest", "core", +} + +read_globals = { + "DIR_DELIM", + "dump", "dump2", + "vector", + "VoxelManip", "VoxelArea", + "PseudoRandom", "PcgRandom", "PerlinNoise", "PerlinNoiseMap", + "ItemStack", + "Settings", + "unpack", + + table = { + fields = { + "copy", + "indexof", + "insert_all", + "key_value_swap", + } + }, + + string = { + fields = { + "split", + "trim", + } + }, + + math = { + fields = { + "hypot", + "sign", + "factorial" + } + }, +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f26ccafe7..21facbd1b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,13 +7,11 @@ But first, some things to note: MineClone 2's development target is to make a free software clone of Minecraft, ***version 1.12***, ***PC edition***, *** + Optifine features supported by the Minetest Engine ***. -MineClone 2 is maintained by two persons. Namely, kay27 and EliasFleckenstein. You can find us -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 or . -There is **no** guarantee we will accept anything from anybody. - 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. @@ -26,8 +24,7 @@ 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 us +* Create a pull request to get your changes merged into master For small changes, sending us a patch is also good. @@ -41,40 +38,30 @@ 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 we will accept anything from anybody. -But we will gladly take in code from others when we feel it saves us 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 +## Features > 1.12 -### 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 +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. -### Instant rejection -* Proprietary **anything** -* Code contains `minetest.env` anywhere +## What we accept -## Coding style guide -* Indentations should reflect the code flow -* Use tabs, not spaces for indentation (tab size = 8) -* Never use `minetest.env` +* 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: diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 000000000..bae665e7c --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,117 @@ +# Credits + +## Creator of MineClone +* davedevils + +## Creator of MineClone2 +* Wuzzy + +## Maintainers +* Fleckenstein +* kay27 +* oilboi + +## Developers +* bzoss +* AFCMS +* epCode +* ryvnf +* iliekprogrammar +* MysticTempest +* Rootyjr +* Nicu +* aligator +* Code-Sploit + +## 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 +* NO11 +* 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 +* oilboi +* 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 + +## 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 diff --git a/LEGAL.md b/LEGAL.md new file mode 100644 index 000000000..e54bdc41b --- /dev/null +++ b/LEGAL.md @@ -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: +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. + diff --git a/MISSING_ENGINE_FEATURES.md b/MISSING_ENGINE_FEATURES.md deleted file mode 100644 index fddb89f6c..000000000 --- a/MISSING_ENGINE_FEATURES.md +++ /dev/null @@ -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. - -## 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 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 -- Sneak+click on inventory slot should be able to put items into additional “fallback inventories” if the first inventory is full. Useful for large chests - -#### 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 diff --git a/README.md b/README.md index 302c188fd..7c3cecece 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. Developed by many people. Not developed or endorsed by Mojang AB. -Version: 0.71.0 +Version: 0.72.0 (in development) ### Gameplay You start in a randomly-generated world made entirely of cubes. You can explore @@ -65,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. @@ -83,23 +75,37 @@ 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. +## Reporting bugs +Please report all bugs and missing Minecraft features here: + + + +## Chating with the community +Join our discord server at: + + + ## 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.12** (later known as “Java Edition”) * MineClone2 also includes Optifine features supported by the Minetest -* Features of later Minecraft versions might sneak in, but they have a low priority -* In general, Minecraft is aimed to be cloned as good as Minetest currently permits (no hacks) +* 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: @@ -128,7 +134,7 @@ The following main features are available: * Clock * Compass * Sponge -* Slime block (does not interact with redstone) +* Slime block * Small plants and saplings * Dyes * Banners @@ -140,19 +146,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) * Some monsters and animals * Redstone-related things -* The End * 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 @@ -177,148 +183,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: - - - -## Chating with the community -Join our discord server at: - - - ## 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 (retired) -* 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 -* kay27 : Experience system, bugfixes, optimizations (Current maintainer) -* [EliasFleckenstein03](https://github.com/EliasFleckenstein03): End crystals, enchanting, burning mobs / players, animated chests, bugfixes (Current maintainer) -* epCode: Better player animations, new logo -* 2mac: Fix bug with powered rail -* 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 : MineClone 2 logo -* Other authors: GUI images - -### Translations -* Wuzzy: German -* Rocher Laurent : French -* wuniversales: Spanish -* kay27 : 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 -* Wuzzy for starting and maintaining MineClone2 for several years -* celeron55 for creating Minetest -* Minetest's modding community for providing a huge selection of mods, some of which ended up in MineClone 2 -* 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`. - -## 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: -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 diff --git a/mods/CORE/mcl_particles/init.lua b/mods/CORE/mcl_particles/init.lua index 757c0452f..48e9db8df 100644 --- a/mods/CORE/mcl_particles/init.lua +++ b/mods/CORE/mcl_particles/init.lua @@ -66,3 +66,58 @@ function mcl_particles.delete_node_particlespawners(pos) 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 min = math.min + 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 + mcl_particles.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 = min(exptime, (7.0/8.0 * (exptime + 0.1) + 0.1)) + smoke_pdef.texture = "mcl_particles_smoke_anim.png^[colorize:#000000:" ..colorize + + mcl_particles.add_node_particlespawner(pos, smoke_pdef, "high") + + table.insert(smoke_pdef_cached[name], table.copy(smoke_pdef)) + end + end + end +end diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index 672036c78..6f1b0ef0d 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -15,7 +15,7 @@ minetest.register_entity("mcl_burning:fire", { pointable = false, glow = -1, }, - + animation_frame = 0, animation_timer = 0, on_step = mcl_burning.fire_entity_step, @@ -23,7 +23,9 @@ minetest.register_entity("mcl_burning:fire", { minetest.register_globalstep(function(dtime) for _, player in pairs(minetest.get_connected_players()) do - mcl_burning.tick(player, dtime) + if player:get_meta():get_float("mcl_burning:burn_time") > 0 then + mcl_burning.tick(player, dtime) + end end end) diff --git a/mods/ENTITIES/mcl_mobs/api/spawning.lua b/mods/ENTITIES/mcl_mobs/api/spawning.lua index f815d8811..2875b27e2 100644 --- a/mods/ENTITIES/mcl_mobs/api/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/api/spawning.lua @@ -12,7 +12,7 @@ local vector_distance = vector.distance -- range for mob count local aoc_range = 32 ---[[ +--[[ THIS IS THE BIG LIST OF ALL BIOMES - used for programming/updating mobs @@ -159,7 +159,6 @@ mobs_spawn = false -- count how many mobs of one type are inside an area local count_mobs = function(pos,mobtype) - print(mobtype) local num = 0 local objs = get_objects_inside_radius(pos, aoc_range) for n = 1, #objs do @@ -171,12 +170,12 @@ local count_mobs = function(pos,mobtype) num = num + 1 end -- count passive mobs only - else + else num = num + 1 end end end - + return num end @@ -195,7 +194,7 @@ end name: the mobs name -dimension: +dimension: "overworld" "nether" "end" @@ -532,7 +531,7 @@ local function biome_check(biome_list, biome_goal) return false end - + --todo mob limiting --MAIN LOOP @@ -553,11 +552,11 @@ if mobs_spawn then if dimension == "void" or dimension == "default" then break -- ignore void and unloaded area end - + local min,max = decypher_limits(player_pos.y) local goal_pos = position_calculation(player_pos) - + local spawning_position_list = find_nodes_in_area_under_air(new_vector(goal_pos.x,min,goal_pos.z), vector.new(goal_pos.x,max,goal_pos.z), {"group:solid", "group:water", "group:lava"}) --couldn't find node diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 6c87b9305..9c47e98fc 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -323,7 +323,7 @@ mobs:register_mob("mobs_mc:enderman", { -- self:teleport(nil) -- self.state = "" --else - if self.attack ~= nil then + if self.attack ~= nil and not minetest.settings:get_bool("creative_mode") then self.state = 'attack' end --end diff --git a/mods/ENTITIES/mobs_mc/mod.conf b/mods/ENTITIES/mobs_mc/mod.conf index a3057faff..98f48b388 100644 --- a/mods/ENTITIES/mobs_mc/mod.conf +++ b/mods/ENTITIES/mobs_mc/mod.conf @@ -1,6 +1,6 @@ name = mobs_mc author = maikerumine description = Adds Minecraft-like monsters and animals. -depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip, mcl_colors +depends = mcl_init, mcl_particles, mcl_mobs, mcl_wip optional_depends = default, mcl_tnt, mcl_bows, mcl_throwing, mcl_fishing, bones, mesecons_materials, mobs_mc_gameconfig, doc_items diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_cat.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_cat.b3d index 9ab4fc10c..1a6ecbbe8 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_cat.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_cat.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_cow.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_cow.b3d index 2f13ba9c4..c00983919 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_cow.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_cow.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_creeper.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_creeper.b3d index 54341579c..e04ffc7b0 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_creeper.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_creeper.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_mooshroom.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_mooshroom.b3d index 725268ea9..c00983919 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_mooshroom.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_mooshroom.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_skeleton.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_skeleton.b3d index be4094c1b..aa1681dbe 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_skeleton.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_skeleton.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_villager_zombie.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_villager_zombie.b3d index 9958b281a..b7dd9d7ee 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_villager_zombie.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_villager_zombie.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_witherskeleton.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_witherskeleton.b3d index 6f78392fe..c1b808307 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_witherskeleton.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_witherskeleton.b3d differ diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_zombie.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_zombie.b3d index f357f68b5..deacf31b6 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_zombie.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_zombie.b3d differ diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index 0c6cacc20..dfcab465a 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -34,13 +34,14 @@ local skeleton = { "mcl_bows_bow_0.png", -- bow "mobs_mc_skeleton.png", -- skeleton } }, - visual_size = {x=3, y=3}, + visual_size = {x=1, y=1}, makes_footstep_sound = true, - sounds = { - random = "mobs_mc_skeleton_random", - death = "mobs_mc_skeleton_death", - damage = "mobs_mc_skeleton_hurt", - distance = 16, + textures = { + { + "mobs_mc_empty.png", -- armor + "mobs_mc_skeleton.png", -- texture + "mcl_bows_bow_0.png", -- wielded_item + } }, walk_velocity = 1.2, run_velocity = 2.4, @@ -114,12 +115,12 @@ mobs:register_mob("mobs_mc:skeleton", skeleton) --################### local stray = table.copy(skeleton) -stray.mesh = "mobs_mc_stray.b3d" +stray.mesh = "mobs_mc_skeleton.b3d" stray.textures = { { - "mcl_bows_bow_0.png", - "mobs_mc_stray.png", "mobs_mc_stray_overlay.png", + "mobs_mc_stray.png", + "mcl_bows_bow_0.png", }, } -- TODO: different sound (w/ echo) @@ -146,8 +147,8 @@ mobs:register_mob("mobs_mc:stray", stray) -- Overworld spawn mobs:spawn_specific( -"mobs_mc:skeleton", -"overworld", +"mobs_mc:skeleton", +"overworld", "ground", { "Mesa", @@ -290,36 +291,36 @@ mobs:spawn_specific( "ExtremeHillsM_underground", "JungleEdgeM_underground", }, -0, -7, -20, -17000, -2, -mobs_mc.spawn_height.overworld_min, +0, +7, +20, +17000, +2, +mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- Nether spawn mobs:spawn_specific( -"mobs_mc:skeleton", -"nether", -"ground", +"mobs_mc:skeleton", +"nether", +"ground", { "Nether" }, -0, -7, -30, -10000, -3, -mobs_mc.spawn_height.nether_min, +0, +7, +30, +10000, +3, +mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) -- Stray spawn -- TODO: Spawn directly under the sky mobs:spawn_specific( -"mobs_mc:stray", -"overworld", +"mobs_mc:stray", +"overworld", "ground", { "ColdTaiga", @@ -327,12 +328,12 @@ mobs:spawn_specific( "IcePlains", "ExtremeHills+_snowtop", }, -0, -7, -20, -19000, -2, -mobs_mc.spawn_height.water, +0, +7, +20, +19000, +2, +mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max) diff --git a/mods/ENTITIES/mobs_mc/skeleton_wither.lua b/mods/ENTITIES/mobs_mc/skeleton_wither.lua index c539e476b..a6a140a6e 100644 --- a/mods/ENTITIES/mobs_mc/skeleton_wither.lua +++ b/mods/ENTITIES/mobs_mc/skeleton_wither.lua @@ -25,11 +25,12 @@ mobs:register_mob("mobs_mc:witherskeleton", { mesh = "mobs_mc_witherskeleton.b3d", textures = { { - "default_tool_stonesword.png", -- sword + "mobs_mc_empty.png", -- armor "mobs_mc_wither_skeleton.png", -- wither skeleton + "default_tool_stonesword.png", -- sword } }, - visual_size = {x=3.6, y=3.6}, + visual_size = {x=1.2, y=1.2}, makes_footstep_sound = true, sounds = { random = "mobs_mc_skeleton_random", @@ -110,4 +111,4 @@ mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max) -- spawn eggs -mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "mobs_mc_spawn_icon_witherskeleton.png", 0) \ No newline at end of file +mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "mobs_mc_spawn_icon_witherskeleton.png", 0) diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_stray_overlay.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_stray_overlay.png index ab00032b2..b4b47a9fb 100644 Binary files a/mods/ENTITIES/mobs_mc/textures/mobs_mc_stray_overlay.png and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_stray_overlay.png differ diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index d251ba823..ab79edfec 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -516,7 +516,7 @@ local function show_trade_formspec(playername, trader, tradenum) "size[9,8.75]" .."background[-0.19,-0.25;9.41,9.49;mobs_mc_trading_formspec_bg.png]" ..disabled_img - .."label[4,0;"..F(minetest.colorize(mcl_colors.DARK_GRAY, S(profession))).."]" + .."label[4,0;"..F(minetest.colorize("#313131", S(profession))).."]" .."list[current_player;main;0,4.5;9,3;9]" .."list[current_player;main;0,7.74;9,1;]" ..b_prev..b_next @@ -1075,8 +1075,8 @@ mobs:register_mob("mobs_mc:villager", { mobs:spawn_specific( -"mobs_mc:villager", -"overworld", +"mobs_mc:villager", +"overworld", "ground", { "FlowerForest", @@ -1096,12 +1096,12 @@ mobs:spawn_specific( "ExtremeHillsM", "BirchForestM", }, -0, -minetest.LIGHT_MAX+1, -30, -20, -4, -mobs_mc.spawn_height.water+1, +0, +minetest.LIGHT_MAX+1, +30, +20, +4, +mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max) -- spawn eggs diff --git a/mods/ENTITIES/mobs_mc/villager_zombie.lua b/mods/ENTITIES/mobs_mc/villager_zombie.lua index 23365e5fe..6c3823d1b 100644 --- a/mods/ENTITIES/mobs_mc/villager_zombie.lua +++ b/mods/ENTITIES/mobs_mc/villager_zombie.lua @@ -41,12 +41,12 @@ mobs:register_mob("mobs_mc:villager_zombie", { visual = "mesh", mesh = "mobs_mc_villager_zombie.b3d", textures = { - {"mobs_mc_zombie_butcher.png"}, - {"mobs_mc_zombie_farmer.png"}, - {"mobs_mc_zombie_librarian.png"}, - {"mobs_mc_zombie_priest.png"}, - {"mobs_mc_zombie_smith.png"}, - {"mobs_mc_zombie_villager.png"} + {"mobs_mc_empty.png", "mobs_mc_zombie_butcher.png", "mobs_mc_empty.png"}, + {"mobs_mc_empty.png", "mobs_mc_zombie_farmer.png", "mobs_mc_empty.png"}, + {"mobs_mc_empty.png", "mobs_mc_zombie_librarian.png", "mobs_mc_empty.png"}, + {"mobs_mc_empty.png", "mobs_mc_zombie_priest.png", "mobs_mc_empty.png"}, + {"mobs_mc_empty.png", "mobs_mc_zombie_smith.png", "mobs_mc_empty.png"}, + {"mobs_mc_empty.png", "mobs_mc_zombie_villager.png", "mobs_mc_empty.png"}, }, visual_size = {x=2.75, y=2.75}, makes_footstep_sound = true, @@ -150,8 +150,8 @@ mobs:register_mob("mobs_mc:villager_zombie", { }) mobs:spawn_specific( -"mobs_mc:villager_zombie", -"overworld", +"mobs_mc:villager_zombie", +"overworld", "ground", { "FlowerForest_underground", @@ -234,15 +234,14 @@ mobs:spawn_specific( "MesaBryce_sandlevel", "Mesa_sandlevel", }, -0, -7, -30, -4090, -4, -mobs_mc.spawn_height.overworld_min, +0, +7, +30, +4090, +4, +mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) --mobs:spawn_specific("mobs_mc:villager_zombie", "overworld", "ground", 0, 7, 30, 60000, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:villager_zombie", S("Zombie Villager"), "mobs_mc_spawn_icon_zombie_villager.png", 0) - diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 55e9f0662..ecb79621d 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -60,7 +60,11 @@ local zombie = { visual = "mesh", mesh = "mobs_mc_zombie.b3d", textures = { - {"mobs_mc_zombie.png"}, + { + "mobs_mc_empty.png", -- armor + "mobs_mc_zombie.png", -- texture + "mobs_mc_empty.png", -- wielded_item + } }, visual_size = {x=3, y=3}, makes_footstep_sound = true, @@ -115,7 +119,13 @@ mobs:register_mob("mobs_mc:baby_zombie", baby_zombie) -- Husk. -- Desert variant of the zombie local husk = table.copy(zombie) -husk.textures = {{"mobs_mc_husk.png"}} +husk.textures = { + { + "mobs_mc_empty.png", -- armor + "mobs_mc_husk.png", -- texture + "mobs_mc_empty.png", -- wielded_item + } + } husk.ignited_by_sunlight = false husk.sunlight_damage = 0 husk.drops = drops_common @@ -140,8 +150,8 @@ mobs:register_mob("mobs_mc:baby_husk", baby_husk) -- Spawning mobs:spawn_specific( -"mobs_mc:zombie", -"overworld", +"mobs_mc:zombie", +"overworld", "ground", { "FlowerForest_underground", @@ -224,17 +234,17 @@ mobs:spawn_specific( "MesaBryce_sandlevel", "Mesa_sandlevel", }, -0, -7, -30, -6000, -4, -mobs_mc.spawn_height.overworld_min, +0, +7, +30, +6000, +4, +mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- Baby zombie is 20 times less likely than regular zombies mobs:spawn_specific( -"mobs_mc:baby_zombie", -"overworld", +"mobs_mc:baby_zombie", +"overworld", "ground", { "FlowerForest_underground", @@ -317,18 +327,18 @@ mobs:spawn_specific( "MesaBryce_sandlevel", "Mesa_sandlevel", }, -0, -7, -30, -60000, -4, -mobs_mc.spawn_height.overworld_min, +0, +7, +30, +60000, +4, +mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) mobs:spawn_specific( -"mobs_mc:husk", -"overworld", +"mobs_mc:husk", +"overworld", "ground", { "Desert", @@ -336,29 +346,29 @@ mobs:spawn_specific( "Savanna", "Savanna_beach", }, -0, -7, -30, -6500, -4, -mobs_mc.spawn_height.overworld_min, +0, +7, +30, +6500, +4, +mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) mobs:spawn_specific( -"mobs_mc:baby_husk", -"overworld", -"ground", +"mobs_mc:baby_husk", +"overworld", +"ground", { "Desert", "SavannaM", "Savanna", "Savanna_beach", }, -0, -7, -30, -65000, -4, -mobs_mc.spawn_height.overworld_min, +0, +7, +30, +65000, +4, +mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max) -- Spawn eggs diff --git a/mods/HELP/doc/doc/init.lua b/mods/HELP/doc/doc/init.lua index 9057cda8e..029914a53 100644 --- a/mods/HELP/doc/doc/init.lua +++ b/mods/HELP/doc/doc/init.lua @@ -35,10 +35,10 @@ doc.FORMSPEC.ENTRY_HEIGHT = doc.FORMSPEC.ENTRY_END_Y - doc.FORMSPEC.ENTRY_START_ -- Internal helper variables local DOC_INTRO = S("This is the help.") -local COLOR_NOT_VIEWED = mcl_colors.AQUA -local COLOR_VIEWED = mcl_colors.WHITE -local COLOR_HIDDEN = mcl_colors.GRAY -local COLOR_ERROR = mcl_colors.RED +local COLOR_NOT_VIEWED = "#00FFFF" -- cyan +local COLOR_VIEWED = "#FFFFFF" -- white +local COLOR_HIDDEN = "#999999" -- gray +local COLOR_ERROR = "#FF0000" -- red local CATEGORYFIELDSIZE = { WIDTH = math.ceil(doc.FORMSPEC.WIDTH / 4), @@ -770,7 +770,7 @@ function doc.generate_entry_list(cid, playername) if name == nil or name == "" then name = S("Nameless entry (@1)", eid) if doc.entry_viewed(playername, cid, eid) then - viewedprefix = mcl_colors.RED + viewedprefix = "#FF4444" else viewedprefix = COLOR_ERROR end diff --git a/mods/HELP/doc/doc/mod.conf b/mods/HELP/doc/doc/mod.conf index 54064551b..0f65ddff7 100644 --- a/mods/HELP/doc/doc/mod.conf +++ b/mods/HELP/doc/doc/mod.conf @@ -2,4 +2,3 @@ name = doc author = Wuzzy description = A simple in-game documentation system which enables mods to add help entries based on templates. optional_depends = unified_inventory, sfinv_buttons, central_message, inventory_plus -depends = mcl_colors diff --git a/mods/HELP/doc/doc_identifier/init.lua b/mods/HELP/doc/doc_identifier/init.lua index 2e041ae2e..a3a35e2fa 100644 --- a/mods/HELP/doc/doc_identifier/init.lua +++ b/mods/HELP/doc/doc_identifier/init.lua @@ -67,7 +67,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) local pos = pointed_thing.under local node = minetest.get_node(pos) if minetest.registered_nodes[node.name] ~= nil then - local nodedef = minetest.registered_nodes[node.name] + --local nodedef = minetest.registered_nodes[node.name] if(node.name == "ignore") then show_message(username, "error_ignore") elseif doc.entry_exists("nodes", node.name) then @@ -198,7 +198,7 @@ minetest.register_craft({ if minetest.get_modpath("mcl_core") ~= nil then minetest.register_craft({ output = "doc_identifier:identifier_solid", - recipe = { { "mcl_core:glass" }, + recipe = { { "mcl_core:glass" }, { "group:stick" } } }) end diff --git a/mods/HELP/doc/doc_items/init.lua b/mods/HELP/doc/doc_items/init.lua index b0be3e12d..ec4da620e 100644 --- a/mods/HELP/doc/doc_items/init.lua +++ b/mods/HELP/doc/doc_items/init.lua @@ -907,7 +907,7 @@ doc.add_category("nodes", { -- Do some cleanup of the probability table if max == 1 or max == nil then -- Sort by rarity - local comp = function(p1, p2) + local comp = function(p1, p2) return p1.rarity < p2.rarity end table.sort(probtables, comp) @@ -1269,7 +1269,6 @@ local function gather_descs() if type(def._doc_items_hidden) == "boolean" then hidden = def._doc_items_hidden end - local custom_image name = scrub_newlines(name) local infotable = { name = name, diff --git a/mods/HELP/mcl_craftguide/init.lua b/mods/HELP/mcl_craftguide/init.lua index 829fc4181..d05d8b3d0 100644 --- a/mods/HELP/mcl_craftguide/init.lua +++ b/mods/HELP/mcl_craftguide/init.lua @@ -33,7 +33,6 @@ local fmt, find, gmatch, match, sub, split, lower = local min, max, floor, ceil = math.min, math.max, math.floor, math.ceil local pairs, next, unpack = pairs, next, unpack -local vec_add, vec_mul = vector.add, vector.multiply local DEFAULT_SIZE = 10 local MIN_LIMIT, MAX_LIMIT = 10, 12 @@ -668,7 +667,7 @@ local function make_formspec(name) fs[#fs + 1] = fmt("label[%f,%f;%s]", sfinv_only and 6.3 or data.iX - 2.2, 0.22, - ESC(colorize(mcl_colors.DARK_GRAY, fmt("%s / %u", data.pagenum, data.pagemax)))) + ESC(colorize("#383838", fmt("%s / %u", data.pagenum, data.pagemax)))) fs[#fs + 1] = fmt([[ image_button[%f,0.12;0.8,0.8;craftguide_prev_icon.png;prev;] @@ -1001,7 +1000,7 @@ else end end) - local function on_use(user) + --[[local function on_use(user) local name = user:get_player_name() if next(recipe_filters) then @@ -1011,7 +1010,7 @@ else end show_formspec(name, "mcl_craftguide", make_formspec(name)) - end + end]] end @@ -1098,7 +1097,6 @@ if progressive_mode then local name = player:get_player_name() init_data(name) local meta = player:get_meta() - local name = player:get_player_name() local data = player_data[name] data.inv_items = deserialize(meta:get_string("inv_items")) or {} @@ -1144,7 +1142,7 @@ else end function mcl_craftguide.show(name) - local player = minetest.get_player_by_name(name) + local player = get_player_by_name(name) if next(recipe_filters) then local data = player_data[name] data.items_raw = get_filtered_items(player) diff --git a/mods/HELP/mcl_doc/init.lua b/mods/HELP/mcl_doc/init.lua index 6948aed04..d926550f8 100644 --- a/mods/HELP/mcl_doc/init.lua +++ b/mods/HELP/mcl_doc/init.lua @@ -62,7 +62,6 @@ end) -- nodes which have flower placement rules doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) - local datastring = "" if def.groups.place_flowerlike == 1 then return S("This plant can only grow on grass blocks and dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.") elseif def.groups.place_flowerlike == 2 then @@ -130,7 +129,7 @@ end) -- Armor doc.sub.items.register_factoid(nil, "use", function(itemstring, def) - local def = minetest.registered_items[itemstring] + --local def = minetest.registered_items[itemstring] local s = "" local head = minetest.get_item_group(itemstring, "armor_head") local torso = minetest.get_item_group(itemstring, "armor_torso") @@ -173,7 +172,6 @@ end) doc.sub.items.register_factoid(nil, "groups", function(itemstring, def) if def._repair_material then local mdef = minetest.registered_items[def._repair_material] - local desc if mdef and mdef.description and mdef.description ~= "" then return S("This item can be repaired at an anvil with: @1.", mdef.description) elseif def._repair_material == "group:wood" then diff --git a/mods/HUD/awards/api.lua b/mods/HUD/awards/api.lua index 6601dd626..d795f0dca 100644 --- a/mods/HUD/awards/api.lua +++ b/mods/HUD/awards/api.lua @@ -447,7 +447,7 @@ function awards.getFormspec(name, to, sid) first = false if def.secret and not award.got then - formspec = formspec .. mcl_colors.DARK_GRAY..minetest.formspec_escape(S("(Secret Award)")) + formspec = formspec .. "#707070" .. minetest.formspec_escape(S("(Secret Award)")) else local title = award.name if def and def.title then @@ -456,7 +456,7 @@ function awards.getFormspec(name, to, sid) if award.got then formspec = formspec .. minetest.formspec_escape(title) else - formspec = formspec .. mcl_colors.GRAY.. minetest.formspec_escape(title) + formspec = formspec .. "#ACACAC" .. minetest.formspec_escape(title) end end end diff --git a/mods/HUD/mcl_bossbars/init.lua b/mods/HUD/mcl_bossbars/init.lua index 08eb527bf..f1d99e013 100644 --- a/mods/HUD/mcl_bossbars/init.lua +++ b/mods/HUD/mcl_bossbars/init.lua @@ -39,7 +39,7 @@ local last_id = 0 function mcl_bossbars.add_bar(player, def, dynamic, priority) local name = player:get_player_name() local bars = mcl_bossbars.bars[name] - local bar = {text = def.text, priority = priority or 0} + local bar = {text = def.text, priority = priority or 0, timeout = def.timeout} bar.color, bar.image = get_color_info(def.color, def.percentage) if dynamic then for _, other in pairs(bars) do @@ -65,7 +65,7 @@ function mcl_bossbars.add_bar(player, def, dynamic, priority) end function mcl_bossbars.remove_bar(id) - mcl_bossbars.static[id].bar.id = nil + mcl_bossbars.static[id].id = nil mcl_bossbars.static[id] = nil end @@ -119,7 +119,7 @@ minetest.register_on_leaveplayer(function(player) mcl_bossbars.bars[name] = nil end) -minetest.register_globalstep(function() +minetest.register_globalstep(function(dtime) for _, player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() local bars = mcl_bossbars.bars[name] @@ -134,7 +134,12 @@ minetest.register_globalstep(function() local hud = table.remove(huds, 1) if bar and bar.id then - table.insert(bars_new, bar) + if bar.timeout then + bar.timeout = bar.timeout - dtime + end + if not bar.timeout or bar.timeout > 0 then + table.insert(bars_new, bar) + end end if bar and not hud then diff --git a/mods/HUD/mcl_credits/init.lua b/mods/HUD/mcl_credits/init.lua index 1e8138ab4..4464a401b 100644 --- a/mods/HUD/mcl_credits/init.lua +++ b/mods/HUD/mcl_credits/init.lua @@ -27,9 +27,9 @@ mcl_credits.people = { "Rootyjr", "Nicu", "aligator", + "Code-Sploit", }}, {"Contributors", 0x52FF00, { - "Code-Sploit", "Laurent Rocher", "HimbeerserverDE", "TechDudie", @@ -55,6 +55,7 @@ mcl_credits.people = { "nickolas360", "yutyo", "ztianyang", + "j45", }}, {"MineClone5", 0xA60014, { "kay27", @@ -63,6 +64,38 @@ mcl_credits.people = { "NO11", "j45", }}, + {"Original Mod Authors", 0x343434, { + "Wuzzy", + "Fleckenstein", + "BlockMen", + "TenPlus1", + "PilzAdam", + "ryvnf", + "stujones11", + "Arcelmi", + "celeron55", + "maikerumine", + "GunshipPenguin", + "Qwertymine3", + "Rochambeau", + "rubenwardy", + "stu", + "oilboi", + "4aiman", + "Kahrl", + "Krock", + "UgnilJoZ", + "lordfingle", + "22i", + "bzoss", + "kilbith", + "xeranas", + "kddekadenz", + "sofar", + "4Evergreen4", + "jordan4ibanez", + "paramat", + }}, {"3D Models", 0x0019FF, { "22i", "tobyplowy", diff --git a/mods/HUD/mcl_death_messages/init.lua b/mods/HUD/mcl_death_messages/init.lua index 8ca686701..6fd7e0c93 100644 --- a/mods/HUD/mcl_death_messages/init.lua +++ b/mods/HUD/mcl_death_messages/init.lua @@ -193,7 +193,7 @@ minetest.register_on_dieplayer(function(player, reason) -- Player was slain by potions if not hitter then return end - + local hittername, hittertype, hittersubtype, shooter local hitter_toolname = get_tool_name(hitter:get_wielded_item()) @@ -222,7 +222,7 @@ minetest.register_on_dieplayer(function(player, reason) end hittersubtype = hitter:get_luaentity().name if hittername then - msg = dmsg("murder", name, hittername) + msg = dmsg("murder_hand", name, hittername) elseif hittersubtype ~= nil and hittersubtype ~= "" then msg = mmsg(hittersubtype, name) else @@ -304,4 +304,4 @@ function mcl_death_messages.player_damage(player, message) if dmg_sequence_number >= 65535 then dmg_sequence_number = 0 end -end \ No newline at end of file +end diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index a69fcef5b..b3ee40bf7 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -442,7 +442,7 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz end local caption = "" if name ~= "inv" and filtername[name] then - caption = "label[0,1.2;"..F(minetest.colorize(mcl_colors.DARK_GRAY, filtername[name])).."]" + caption = "label[0,1.2;"..F(minetest.colorize("#313131", filtername[name])).."]" end formspec = "size[10,9.3]".. diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index e9da9486e..054424051 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -109,10 +109,10 @@ local function set_inventory(player, armor_change_only) mcl_formspec.get_itemslot_bg(0,3,1,1).. armor_slot_imgs.. -- craft and inventory - "label[0,4;"..F(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4;"..F(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. - "label[4,0.5;"..F(minetest.colorize(mcl_colors.DARK_GRAY, S("Crafting"))).."]".. + "label[4,0.5;"..F(minetest.colorize("#313131", S("Crafting"))).."]".. "list[current_player;craft;4,1;2,2]".. "list[current_player;craftpreview;7,1.5;1,1;]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. diff --git a/mods/HUD/mcl_inventory/mod.conf b/mods/HUD/mcl_inventory/mod.conf index edd6343c7..fa6b2c2f4 100644 --- a/mods/HUD/mcl_inventory/mod.conf +++ b/mods/HUD/mcl_inventory/mod.conf @@ -1,6 +1,6 @@ name = mcl_inventory author = BlockMen description = Adds the player inventory and creative inventory. -depends = mcl_init, mcl_formspec, mcl_colors +depends = mcl_init, mcl_formspec optional_depends = mcl_player, _mcl_autogroup, mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua index 1fd63cb4d..b6d0d2ef6 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua @@ -13,12 +13,12 @@ local S = minetest.get_translator("mcl_dispensers") local setup_dispenser = function(pos) -- Set formspec and inventory local form = "size[9,8.75]".. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[3,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Dispenser"))).."]".. + "label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dispenser"))).."]".. "list[current_name;main;3,0.5;3,3;]".. mcl_formspec.get_itemslot_bg(3,0.5,3,3).. "listring[current_name;main]".. diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/mod.conf b/mods/ITEMS/REDSTONE/mcl_dispensers/mod.conf index ac1b56c7d..13cdb5f5a 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/mod.conf +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/mod.conf @@ -1,3 +1,3 @@ name = mcl_dispensers -depends = mcl_init, mcl_formspec, mesecons, mcl_sounds, mcl_tnt, mcl_worlds, mcl_core, mcl_nether, mcl_armor_stand, mcl_armor, mcl_colors +depends = mcl_init, mcl_formspec, mesecons, mcl_sounds, mcl_tnt, mcl_worlds, mcl_core, mcl_nether, mcl_armor_stand, mcl_armor optional_depends = doc, screwdriver diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua index 0d41c3552..715a85f3d 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua @@ -14,12 +14,12 @@ local S = minetest.get_translator("mcl_droppers") local setup_dropper = function(pos) -- Set formspec and inventory local form = "size[9,8.75]".. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[3,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Dropper"))).."]".. + "label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dropper"))).."]".. "list[current_name;main;3,0.5;3,3;]".. mcl_formspec.get_itemslot_bg(3,0.5,3,3).. "listring[current_name;main]".. diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua index b41d9c2fe..1bf968a82 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init_new.lua @@ -15,10 +15,10 @@ local setup_dropper = function(pos) -- Set formspec and inventory local form = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;crafting_inventory_9_slots.png]".. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,7.74;9,1;]".. - "label[3,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Dropper"))).."]".. + "label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dropper"))).."]".. "list[current_name;main;3,0.5;3,3;]".. "listring[current_name;main]".. "listring[current_player;main]" diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/mod.conf b/mods/ITEMS/REDSTONE/mcl_droppers/mod.conf index b5cf8f0b7..bbb1c19f2 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/mod.conf +++ b/mods/ITEMS/REDSTONE/mcl_droppers/mod.conf @@ -1,3 +1,3 @@ name = mcl_droppers -depends = mcl_init, mcl_formspec, mesecons, mcl_util, mcl_colors +depends = mcl_init, mcl_formspec, mesecons, mcl_util optional_depends = doc, screwdriver diff --git a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua index c7c4a4ca2..9aefae96c 100644 --- a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua @@ -117,83 +117,90 @@ minetest.register_craft({ {"mcl_core:stick"},} }) -mcl_torches.register_torch("mesecon_torch_off", S("Redstone Torch (off)"), - nil, - nil, - "jeija_torches_off.png", - "mcl_torches_torch_floor.obj", "mcl_torches_torch_wall.obj", - {"jeija_torches_off.png"}, - 0, - {dig_immediate=3, dig_by_water=1, redstone_torch=2, mesecon_ignore_opaque_dig=1, not_in_creative_inventory=1}, - mcl_sounds.node_sound_wood_defaults(), - { - mesecons = { - receptor = { - state = mesecon.state.off, - rules = torch_get_output_rules, - }, - effector = { - state = mesecon.state.on, - rules = torch_get_input_rules, - action_off = torch_action_off, - }, +local off_def = { + name = "mesecon_torch_off", + description = S("Redstone Torch (off)"), + doc_items_create_entry = false, + icon = "jeija_torches_off.png", + tiles = {"jeija_torches_off.png"}, + light = 0, + groups = {dig_immediate=3, dig_by_water=1, redstone_torch=2, mesecon_ignore_opaque_dig=1, not_in_creative_inventory=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + drop = "mesecons_torch:mesecon_torch_on", +} + +mcl_torches.register_torch(off_def) + +local off_override = { + mesecons = { + receptor = { + state = mesecon.state.off, + rules = torch_get_output_rules, + }, + effector = { + state = mesecon.state.on, + rules = torch_get_input_rules, + action_off = torch_action_off, }, - drop = "mesecons_torch:mesecon_torch_on", - _doc_items_create_entry = false, } -) +} -mcl_torches.register_torch("mesecon_torch_overheated", S("Redstone Torch (overheated)"), - nil, - nil, - "jeija_torches_off.png", - "mcl_torches_torch_floor.obj", "mcl_torches_torch_wall.obj", - {"jeija_torches_off.png"}, - 0, - {dig_immediate=3, dig_by_water=1, redstone_torch=2, mesecon_ignore_opaque_dig=1, not_in_creative_inventory=1}, - mcl_sounds.node_sound_wood_defaults(), - { - drop = "mesecons_torch:mesecon_torch_on", - _doc_items_create_entry = false, - on_timer = function(pos, elapsed) - if not mesecon.is_powered(pos) then - local node = minetest.get_node(pos) - torch_action_off(pos, node) - end - end, - } -) +minetest.override_item("mesecons_torch:mesecon_torch_off", off_override) +minetest.override_item("mesecons_torch:mesecon_torch_off_wall", off_override) +local overheated_def = table.copy(off_def) +overheated_def.name = "mesecon_torch_overheated" +overheated_def.description = S("Redstone Torch (overheated)") +mcl_torches.register_torch(overheated_def) -mcl_torches.register_torch("mesecon_torch_on", S("Redstone Torch"), - S("A redstone torch is a redstone component which can be used to invert a redstone signal. It supplies its surrounding blocks with redstone power, except for the block it is attached to. A redstone torch is normally lit, but it can also be turned off by powering the block it is attached to. While unlit, a redstone torch does not power anything."), - S("Redstone torches can be placed at the side and on the top of full solid opaque blocks."), - "jeija_torches_on.png", - "mcl_torches_torch_floor.obj", "mcl_torches_torch_wall.obj", - {"jeija_torches_on.png"}, - 7, - {dig_immediate=3, dig_by_water=1, redstone_torch=1, mesecon_ignore_opaque_dig=1}, - mcl_sounds.node_sound_wood_defaults(), - { - on_destruct = function(pos, oldnode) +local overheated_override = { + on_timer = function(pos, elapsed) + if not mesecon.is_powered(pos) then local node = minetest.get_node(pos) - torch_action_on(pos, node) - end, - mesecons = { - receptor = { - state = mesecon.state.on, - rules = torch_get_output_rules - }, - effector = { - state = mesecon.state.off, - rules = torch_get_input_rules, - action_on = torch_action_on, - }, + torch_action_off(pos, node) + end + end +} + +minetest.override_item("mesecons_torch:mesecon_torch_overheated", overheated_override) +minetest.override_item("mesecons_torch:mesecon_torch_overheated_wall", overheated_override) + +local on_def = { + name = "mesecon_torch_on", + description = S("Redstone Torch"), + doc_items_longdesc = S("A redstone torch is a redstone component which can be used to invert a redstone signal. It supplies its surrounding blocks with redstone power, except for the block it is attached to. A redstone torch is normally lit, but it can also be turned off by powering the block it is attached to. While unlit, a redstone torch does not power anything."), + doc_items_usagehelp = S("Redstone torches can be placed at the side and on the top of full solid opaque blocks."), + icon = "jeija_torches_on.png", + tiles = {"jeija_torches_on.png"}, + light = 7, + groups = {dig_immediate=3, dig_by_water=1, redstone_torch=1, mesecon_ignore_opaque_dig=1}, + sounds = mcl_sounds.node_sound_wood_defaults(), +} + +mcl_torches.register_torch(on_def) + +local on_override = { + on_destruct = function(pos, oldnode) + local node = minetest.get_node(pos) + torch_action_on(pos, node) + end, + mesecons = { + receptor = { + state = mesecon.state.on, + rules = torch_get_output_rules }, - _tt_help = S("Provides redstone power when it's not powered itself"), - } -) + effector = { + state = mesecon.state.off, + rules = torch_get_input_rules, + action_on = torch_action_on, + }, + }, + _tt_help = S("Provides redstone power when it's not powered itself"), +} + +minetest.override_item("mesecons_torch:mesecon_torch_on", on_override) +minetest.override_item("mesecons_torch:mesecon_torch_on_wall", on_override) minetest.register_node("mesecons_torch:redstoneblock", { description = S("Block of Redstone"), diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index 1845ed776..c3c238e7f 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -16,7 +16,7 @@ local function get_anvil_formspec(set_name) end return "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;mcl_anvils_inventory.png]".. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. @@ -27,7 +27,7 @@ local function get_anvil_formspec(set_name) mcl_formspec.get_itemslot_bg(4,2.5,1,1).. "list[context;output;8,2.5;1,1;]".. mcl_formspec.get_itemslot_bg(8,2.5,1,1).. - "label[3,0.1;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Repair and Name"))).."]".. + "label[3,0.1;"..minetest.formspec_escape(minetest.colorize("#313131", S("Repair and Name"))).."]".. "field[3.25,1;4,1;name;;"..minetest.formspec_escape(set_name).."]".. "field_close_on_enter[name;false]".. "button[7,0.7;2,1;name_button;"..minetest.formspec_escape(S("Set Name")).."]".. diff --git a/mods/ITEMS/mcl_anvils/mod.conf b/mods/ITEMS/mcl_anvils/mod.conf index cbb5dc223..cd4fa02a8 100644 --- a/mods/ITEMS/mcl_anvils/mod.conf +++ b/mods/ITEMS/mcl_anvils/mod.conf @@ -1,5 +1,5 @@ name = mcl_anvils author = Wuzzy description = Anvils mods for MCL2 -depends = mcl_init, mcl_formspec, mcl_sounds, tt, mcl_enchanting, mcl_colors +depends = mcl_init, mcl_formspec, mcl_sounds, tt, mcl_enchanting optional_depends = mcl_core, screwdriver diff --git a/mods/ITEMS/mcl_armor/armor.lua b/mods/ITEMS/mcl_armor/armor.lua index 05a020016..a35841fe2 100644 --- a/mods/ITEMS/mcl_armor/armor.lua +++ b/mods/ITEMS/mcl_armor/armor.lua @@ -368,6 +368,7 @@ mcl_player.player_register_model("mcl_armor_character.b3d", { run_walk_mine = {x=461, y=480}, sit_mount = {x=484, y=484}, die = {x=498, y=498}, + fly = {x=502, y=581}, }, }) @@ -396,6 +397,8 @@ mcl_player.player_register_model("mcl_armor_character_female.b3d", { run_walk = {x=440, y=459}, run_walk_mine = {x=461, y=480}, sit_mount = {x=484, y=484}, + die = {x=498, y=498}, + fly = {x=502, y=581}, }, }) diff --git a/mods/ITEMS/mcl_armor/init.lua b/mods/ITEMS/mcl_armor/init.lua index c5502cf42..df06ecd04 100644 --- a/mods/ITEMS/mcl_armor/init.lua +++ b/mods/ITEMS/mcl_armor/init.lua @@ -8,6 +8,21 @@ dofile(minetest.get_modpath(minetest.get_current_modname()).."/alias.lua") local longdesc = S("This is a piece of equippable armor which reduces the amount of damage you receive.") local usage = S("To equip it, put it on the corresponding armor slot in your inventory menu.") +minetest.register_tool("mcl_armor:elytra", { + description = S("Elytra"), + _doc_items_longdesc = longdesc, + _doc_items_usagehelp = usage, + inventory_image = "mcl_armor_inv_elytra.png", + groups = {armor_torso=1, mcl_armor_points=0, mcl_armor_uses=10, enchantability=0}, + _repair_material = "mcl_mobitems:leather", + sounds = { + _mcl_armor_equip = "mcl_armor_equip_leather", + _mcl_armor_unequip = "mcl_armor_unequip_leather", + }, + on_place = armor.on_armor_use, + on_secondary_use = armor.on_armor_use, +}) + minetest.register_tool("mcl_armor:helmet_leather", { description = S("Leather Cap"), _doc_items_longdesc = longdesc, @@ -322,7 +337,7 @@ local craft_ingreds = { gold = { "mcl_core:gold_ingot", "mcl_core:gold_nugget" }, diamond = { "mcl_core:diamond" }, chain = { nil, "mcl_core:iron_nugget"} , -} +} for k, v in pairs(craft_ingreds) do -- material @@ -389,4 +404,3 @@ for k, v in pairs(craft_ingreds) do }) end end - diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d index a658f753c..95f763eab 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend index 12869b59d..a5626aacc 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d index 44494d1ec..1b4205344 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d and b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.b3d differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend index c854a49e5..828cd942c 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend and b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend1 b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend1 new file mode 100644 index 000000000..1a13f1c92 Binary files /dev/null and b/mods/ITEMS/mcl_armor/models/mcl_armor_character_female.blend1 differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_elytra.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_elytra.png new file mode 100644 index 000000000..b51f2a564 Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_elytra.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_elytra.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_elytra.png new file mode 100644 index 000000000..f5d5cfda6 Binary files /dev/null and b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_elytra.png differ diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index ce76f47fd..63ad0c0b8 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -35,6 +35,49 @@ mcl_banners.colors = { ["unicolor_light_blue"] = {"light_blue", S("Light Blue Banner"), "mcl_wool:light_blue", "#4040CF", "mcl_dye:lightblue", N("Light Blue") }, } + +local pattern_names = { + "", + "border", + "bricks", + "circle", + "creeper", + "cross", + "curly_border", + "diagonal_up_left", + "diagonal_up_right", + "diagonal_right", + "diagonal_left", + "flower", + "gradient", + "gradient_up", + "half_horizontal_bottom", + "half_horizontal", + "half_vertical", + "half_vertical_right", + "thing", + "rhombus", + "skull", + "small_stripes", + "square_bottom_left", + "square_bottom_right", + "square_top_left", + "square_top_right", + "straight_cross", + "stripe_bottom", + "stripe_center", + "stripe_downleft", + "stripe_downright", + "stripe_left", + "stripe_middle", + "stripe_right", + "stripe_top", + "triangle_bottom", + "triangle_top", + "triangles_bottom", + "triangles_top", +} + local colors_reverse = {} for k,v in pairs(mcl_banners.colors) do colors_reverse["mcl_banners:banner_item_"..v[1]] = k @@ -300,24 +343,72 @@ minetest.register_node("mcl_banners:hanging_banner", { end, }) +-- for pattern_name, pattern in pairs(patterns) do for colorid, colortab in pairs(mcl_banners.colors) do + for i, pattern_name in ipairs(pattern_names) do local itemid = colortab[1] local desc = colortab[2] local wool = colortab[3] local colorize = colortab[4] - local itemstring = "mcl_banners:banner_item_"..itemid - local inv - if colorize then - inv = "mcl_banners_item_base.png^(mcl_banners_item_overlay.png^[colorize:"..colorize..")" + local itemstring + if pattern_name == "" then + itemstring = "mcl_banners:banner_item_" .. itemid else - inv = "mcl_banners_item_base.png^mcl_banners_item_overlay.png" + itemstring = "mcl_banners:banner_preview" .. "_" .. pattern_name .. "_" .. itemid end + local inv + local base + local finished_banner + if pattern_name == "" then + if colorize then + -- Base texture with base color + base = "mcl_banners_item_base.png^(mcl_banners_item_overlay.png^[colorize:"..colorize..")^[resize:32x32" + else + base = "mcl_banners_item_base.png^mcl_banners_item_overlay.png^[resize:32x32" + end + finished_banner = base + else + -- Banner item preview background + base = "mcl_banners_item_base.png^(mcl_banners_item_overlay.png^[colorize:#CCCCCC)^[resize:32x32" + + desc = S("Preview Banner") + + local pattern = "mcl_banners_" .. pattern_name .. ".png" + local color = colorize + + -- Generate layer texture + + -- TODO: The layer texture in the icon is squished + -- weirdly because the width/height aspect ratio of + -- the banner icon is 1:1.5, whereas the aspect ratio + -- of the banner entity is 1:2. A solution would be to + -- redraw the pattern textures as low-resolution pixel + -- art and use that instead. + + local layer = "(([combine:20x40:-2,-2="..pattern.."^[resize:16x24^[colorize:"..color..":"..layer_ratio.."))" + + function escape(text) + return text:gsub("%^", "\\%^"):gsub(":", "\\:") -- :gsub("%(", "\\%("):gsub("%)", "\\%)") + end + + finished_banner = "[combine:32x32:0,0=" .. escape(base) .. ":8,4=" .. escape(layer) + end + + inv = finished_banner + -- Banner items. - -- This is the player-visible banner item. It comes in 16 base colors. + -- This is the player-visible banner item. It comes in 16 base colors with a lot of patterns. -- The multiple items are really only needed for the different item images. -- TODO: Combine the items into only 1 item. + local groups + if pattern_name == "" then + groups = { banner = 1, deco_block = 1, flammable = -1 } + else + groups = { not_in_creative_inventory = 1 } + end + minetest.register_craftitem(itemstring, { description = desc, _tt_help = S("Paintable decoration"), @@ -326,7 +417,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do wield_image = inv, -- Banner group groups together the banner items, but not the nodes. -- Used for crafting. - groups = { banner = 1, deco_block = 1, flammable = -1 }, + groups = groups, stack_max = 16, on_place = function(itemstack, placer, pointed_thing) @@ -492,6 +583,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do -- Add item to node alias doc.add_entry_alias("nodes", "mcl_banners:standing_banner", "craftitems", itemstring) end + end end if minetest.get_modpath("doc") then diff --git a/mods/ITEMS/mcl_banners/patterncraft.lua b/mods/ITEMS/mcl_banners/patterncraft.lua index 31782a42b..fbd0c9e33 100644 --- a/mods/ITEMS/mcl_banners/patterncraft.lua +++ b/mods/ITEMS/mcl_banners/patterncraft.lua @@ -253,6 +253,11 @@ for colorid, colortab in pairs(mcl_banners.colors) do dye_to_colorid_mapping[colortab[5]] = colorid end +local dye_to_itemid_mapping = {} +for colorid, colortab in pairs(mcl_banners.colors) do + dye_to_itemid_mapping[colortab[5]] = colortab[1] +end + -- Create a banner description containing all the layer names mcl_banners.make_advanced_banner_description = function(description, layers) if layers == nil or #layers == 0 then @@ -491,7 +496,14 @@ local banner_pattern_craft = function(itemstack, player, old_craft_grid, craft_i imeta:set_string("description", ometa:get_string("description")) imeta:set_string("name", mname) end - return itemstack + + if craft_predict then + local itemid_prefix = "mcl_banners:banner_preview" + local coloritemid = dye_to_itemid_mapping[dye] + return ItemStack(itemid_prefix .. "_" .. matching_pattern .. "_" .. coloritemid) + else + return itemstack + end end minetest.register_craft_predict(function(itemstack, player, old_craft_grid, craft_inv) diff --git a/mods/ITEMS/mcl_beds/api.lua b/mods/ITEMS/mcl_beds/api.lua index a2df1bdf3..c0b25b1c5 100644 --- a/mods/ITEMS/mcl_beds/api.lua +++ b/mods/ITEMS/mcl_beds/api.lua @@ -1,23 +1,95 @@ local S = minetest.get_translator("mcl_beds") -local function destruct_bed(pos, oldnode) - local node = oldnode or minetest.get_node(pos) +local minetest_get_node = minetest.get_node +local minetest_get_node_or_nil = minetest.get_node_or_nil +local minetest_remove_node = minetest.remove_node +local minetest_facedir_to_dir = minetest.facedir_to_dir +local minetest_add_item = minetest.add_item +local vector_add = vector.add +local vector_subtract = vector.subtract + +local function get_bed_next_node(pos, node) + local node = node or minetest_get_node_or_nil(pos) if not node then return end - local dir = minetest.facedir_to_dir(node.param2) - local pos2, node2 + + local dir = minetest_facedir_to_dir(node.param2) + + local pos2, bottom if string.sub(node.name, -4) == "_top" then - pos2 = vector.subtract(pos, dir) - node2 = minetest.get_node(pos2) - if node2 and string.sub(node2.name, -7) == "_bottom" then - minetest.remove_node(pos2) - end - minetest.check_for_falling(pos) - elseif string.sub(node.name, -7) == "_bottom" then - minetest.add_item(pos, node.name) - pos2 = vector.add(pos, dir) - node2 = minetest.get_node(pos2) + pos2 = vector_subtract(pos, dir) + else + pos2 = vector_add(pos, dir) + bottom = true + end + + local node2 = minetest_get_node(pos2) + return pos2, node2, bottom, dir +end + +local function rotate(pos, node, user, mode, new_param2) + if mode ~= screwdriver.ROTATE_FACE then + return false + end + + local p, node2, bottom = get_bed_next_node(pos, node) + if not node2 then return end + + local name = node2.name + if not minetest.get_item_group(name, "bed") == 2 or not node.param2 == node2.param2 then return false end + + if bottom then + name = string.sub(name, 1, -5) + else + name = string.sub(name, 1, -8) + end + + if minetest.is_protected(p, user:get_player_name()) then + minetest.record_protection_violation(p, user:get_player_name()) + return false + end + + local new_dir, newp = minetest_facedir_to_dir(new_param2) + if bottom then + newp = vector_add(pos, new_dir) + else + newp = vector_subtract(pos, new_dir) + end + + local node3 = minetest_get_node_or_nil(newp) + if not node3 then return false end + + local node_def = minetest.registered_nodes[node3.name] + if not node_def or not node_def.buildable_to then return false end + + if minetest.is_protected(newp, user:get_player_name()) then + minetest.record_protection_violation(newp, user:get_player_name()) + return false + end + + node.param2 = new_param2 + -- do not remove_node here - it will trigger destroy_bed() + minetest.swap_node(p, {name = "air"}) + minetest.swap_node(pos, node) + minetest.swap_node(newp, {name = name .. (bottom and "_top" or "_bottom"), param2 = new_param2}) + + return true +end + + +local function destruct_bed(pos, oldnode) + local node = oldnode or minetest_get_node_or_nil(pos) + if not node then return end + + local pos2, node2, bottom = get_bed_next_node(pos, oldnode) + + if bottom then + minetest_add_item(pos, node.name) if node2 and string.sub(node2.name, -4) == "_top" then - minetest.remove_node(pos2) + minetest_remove_node(pos2) + end + else + if node2 and string.sub(node2.name, -7) == "_bottom" then + minetest_remove_node(pos2) end end end @@ -94,7 +166,7 @@ function mcl_beds.register_bed(name, def) local under = pointed_thing.under -- Use pointed node's on_rightclick function first, if present - local node = minetest.get_node(under) + local node = minetest_get_node(under) if placer and not placer:get_player_control().sneak then if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack @@ -102,7 +174,7 @@ function mcl_beds.register_bed(name, def) end local pos - local undername = minetest.get_node(under).name + local undername = minetest_get_node(under).name if minetest.registered_items[undername] and minetest.registered_items[undername].buildable_to then pos = under else @@ -115,13 +187,13 @@ function mcl_beds.register_bed(name, def) return itemstack end - local node_def = minetest.registered_nodes[minetest.get_node(pos).name] + local node_def = minetest.registered_nodes[minetest_get_node(pos).name] if not node_def or not node_def.buildable_to then return itemstack end local dir = minetest.dir_to_facedir(placer:get_look_dir()) - local botpos = vector.add(pos, minetest.facedir_to_dir(dir)) + local botpos = vector_add(pos, minetest_facedir_to_dir(dir)) if minetest.is_protected(botpos, placer:get_player_name()) and not minetest.check_player_privs(placer, "protection_bypass") then @@ -129,7 +201,7 @@ function mcl_beds.register_bed(name, def) return itemstack end - local botdef = minetest.registered_nodes[minetest.get_node(botpos).name] + local botdef = minetest.registered_nodes[minetest_get_node(botpos).name] if not botdef or not botdef.buildable_to then return itemstack end @@ -152,38 +224,7 @@ function mcl_beds.register_bed(name, def) return itemstack end, - on_rotate = function(pos, node, user, mode, new_param2) - local dir = minetest.facedir_to_dir(node.param2) - local p = vector.add(pos, dir) - local node2 = minetest.get_node_or_nil(p) - if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or - not node.param2 == node2.param2 then - return false - end - if minetest.is_protected(p, user:get_player_name()) then - minetest.record_protection_violation(p, user:get_player_name()) - return false - end - if mode ~= screwdriver.ROTATE_FACE then - return false - end - local newp = vector.add(pos, minetest.facedir_to_dir(new_param2)) - local node3 = minetest.get_node_or_nil(newp) - local node_def = node3 and minetest.registered_nodes[node3.name] - if not node_def or not node_def.buildable_to then - return false - end - if minetest.is_protected(newp, user:get_player_name()) then - minetest.record_protection_violation(newp, user:get_player_name()) - return false - end - node.param2 = new_param2 - -- do not remove_node here - it will trigger destroy_bed() - minetest.set_node(p, {name = "air"}) - minetest.set_node(pos, node) - minetest.set_node(newp, {name = name .. "_top", param2 = new_param2}) - return true - end, + on_rotate = rotate, }) local node_box_top, selection_box_top, collision_box_top @@ -217,7 +258,7 @@ function mcl_beds.register_bed(name, def) mcl_beds.on_rightclick(pos, clicker, true) return itemstack end, - on_rotate = false, + on_rotate = rotate, after_destruct = destruct_bed, }) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index 93e981a96..badcf99e4 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -4,6 +4,8 @@ local LIGHT_TORCH = 10 stairs = {} +local fire_enabled = minetest.settings:get_bool("enable_fire", true) + local fire_help, eternal_fire_help if fire_enabled then fire_help = S("Fire is a damaging and destructive but short-lived kind of block. It will destroy and spread towards near flammable blocks, but fire will disappear when there is nothing to burn left. It will be extinguished by nearby water and rain. Fire can be destroyed safely by punching it, but it is hurtful if you stand directly in it. If a fire is started above netherrack or a magma block, it will immediately turn into an eternal fire.") @@ -43,7 +45,7 @@ local alldirs = {{x=0,y=0,z=1}, {x=1,y=0,z=0}, {x=0,y=0,z=-1}, {x=-1,y=0,z=0}, { minetest.register_node("mcl_blackstone:blackstone", { description = S("Blackstone"), - tiles = {"mcl_blackstone.png"}, + tiles = {"mcl_blackstone_top.png", "mcl_blackstone_top.png", "mcl_blackstone_side.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1}, @@ -53,7 +55,7 @@ minetest.register_node("mcl_blackstone:blackstone", { minetest.register_node("mcl_blackstone:blackstone_gilded", { description = S("Gilded Blackstone"), - tiles = {"mcl_blackstone.png^mcl_blackstone_gilded_side.png"}, + tiles = {"mcl_blackstone_side.png^mcl_blackstone_gilded_side.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, groups = {cracky = 3, pickaxey=2, material_stone=1, xp=1}, @@ -777,321 +779,21 @@ for s=1, #specialstones do end ]]-- - - - - ---torches -local spawn_flames_floor = function(pos) - -- Flames - mcl_particles.add_node_particlespawner(pos, { - amount = 8, - time = 0, - minpos = vector.add(pos, { x = -0.1, y = 0.05, z = -0.1 }), - maxpos = vector.add(pos, { x = 0.1, y = 0.15, z = 0.1 }), - minvel = { x = -0.01, y = 0, z = -0.01 }, - maxvel = { x = 0.01, y = 0.1, z = 0.01 }, - minexptime = 0.3, - maxexptime = 0.6, - minsize = 0.7, - maxsize = 2, - texture = "mcl_particles_flame.png", - glow = 10, - }, "low") - -- Smoke - mcl_particles.add_node_particlespawner(pos, { - amount = 0.5, - time = 0, - minpos = vector.add(pos, { x = -1/16, y = 0.04, z = -1/16 }), - maxpos = vector.add(pos, { x = -1/16, y = 0.06, z = -1/16 }), - minvel = { x = 0, y = 0.5, z = 0 }, - maxvel = { x = 0, y = 0.6, z = 0 }, - minexptime = 2.0, - maxexptime = 2.0, - minsize = 1.5, - maxsize = 1.5, - texture = "mcl_particles_smoke_anim.png", - animation = { - type = "vertical_frames", - aspect_w = 8, - aspect_h = 8, - length = 2.05, - }, - }, "medium") -end - -local spawn_flames_wall = function(pos, param2) - local minrelpos, maxrelpos - local dir = minetest.wallmounted_to_dir(param2) - if dir.x < 0 then - minrelpos = { x = -0.38, y = 0.04, z = -0.1 } - maxrelpos = { x = -0.2, y = 0.14, z = 0.1 } - elseif dir.x > 0 then - minrelpos = { x = 0.2, y = 0.04, z = -0.1 } - maxrelpos = { x = 0.38, y = 0.14, z = 0.1 } - elseif dir.z < 0 then - minrelpos = { x = -0.1, y = 0.04, z = -0.38 } - maxrelpos = { x = 0.1, y = 0.14, z = -0.2 } - elseif dir.z > 0 then - minrelpos = { x = -0.1, y = 0.04, z = 0.2 } - maxrelpos = { x = 0.1, y = 0.14, z = 0.38 } - else - return - end - -- Flames - mcl_particles.add_node_particlespawner(pos, { - amount = 8, - time = 0, - minpos = vector.add(pos, minrelpos), - maxpos = vector.add(pos, maxrelpos), - minvel = { x = -0.01, y = 0, z = -0.01 }, - maxvel = { x = 0.01, y = 0.1, z = 0.01 }, - minexptime = 0.3, - maxexptime = 0.6, - minsize = 0.7, - maxsize = 2, - texture = "mcl_particles_flame.png", - glow = 10, - }, "low") - -- Smoke - mcl_particles.add_node_particlespawner(pos, { - amount = 0.5, - time = 0, - minpos = vector.add(pos, minrelpos), - maxpos = vector.add(pos, maxrelpos), - minvel = { x = 0, y = 0.5, z = 0 }, - maxvel = { x = 0, y = 0.6, z = 0 }, - minexptime = 2.0, - maxexptime = 2.0, - minsize = 1.5, - maxsize = 1.5, - texture = "mcl_particles_smoke_anim.png", - animation = { - type = "vertical_frames", - aspect_w = 8, - aspect_h = 8, - length = 2.05, - }, - }, "medium") -end - -local remove_flames = function(pos) - mcl_particles.delete_node_particlespawners(pos) -end - --- --- 3d torch part --- - --- Check if placement at given node is allowed -local function check_placement_allowed(node, wdir) - -- Torch placement rules: Disallow placement on some nodes. General rule: Solid, opaque, full cube collision box nodes are allowed. - -- Special allowed nodes: - -- * soul sand - -- * mob spawner - -- * chorus flower - -- * glass, barrier, ice - -- * Fence, wall, end portal frame with ender eye: Only on top - -- * Slab, stairs: Only on top if upside down - - -- Special forbidden nodes: - -- * Piston, sticky piston - local def = minetest.registered_nodes[node.name] - if not def then - return false - -- No ceiling torches - elseif wdir == 0 then - return false - elseif not def.buildable_to then - if node.name ~= "mcl_core:ice" and node.name ~= "mcl_nether:soul_sand" and node.name ~= "mcl_mobspawners:spawner" and node.name ~= "mcl_core:barrier" and node.name ~= "mcl_end:chorus_flower" and node.name ~= "mcl_end:chorus_flower_dead" and (not def.groups.glass) and - ((not def.groups.solid) or (not def.groups.opaque)) then - -- Only allow top placement on these nodes - if node.name == "mcl_end:dragon_egg" or node.name == "mcl_portals:end_portal_frame_eye" or def.groups.fence == 1 or def.groups.wall or def.groups.slab_top == 1 or def.groups.anvil or def.groups.pane or (def.groups.stair == 1 and minetest.facedir_to_dir(node.param2).y ~= 0) then - if wdir ~= 1 then - return false - end - else - return false - end - elseif minetest.get_item_group(node.name, "piston") >= 1 then - return false - end - end - return true -end - -mcl_torches = {} - -mcl_torches.register_torch = function(substring, description, doc_items_longdesc, doc_items_usagehelp, icon, mesh_floor, mesh_wall, tiles, light, groups, sounds, moredef, moredef_floor, moredef_wall) - local itemstring = minetest.get_current_modname()..":"..substring - local itemstring_wall = minetest.get_current_modname()..":"..substring.."_wall" - - if light == nil then light = minetest.LIGHT_MAX end - if mesh_floor == nil then mesh_floor = "mcl_torches_torch_floor.obj" end - if mesh_wall == nil then mesh_wall = "mcl_torches_torch_wall.obj" end - if groups == nil then groups = {} end - - groups.attached_node = 1 - groups.torch = 1 - groups.dig_by_water = 1 - groups.destroy_by_lava_flow = 1 - groups.dig_by_piston = 1 - - local floordef = { - description = description, - _doc_items_longdesc = doc_items_longdesc, - _doc_items_usagehelp = doc_items_usagehelp, - drawtype = "mesh", - mesh = mesh_floor, - inventory_image = icon, - wield_image = icon, - tiles = tiles, - paramtype = "light", - paramtype2 = "wallmounted", - sunlight_propagates = true, - is_ground_content = false, - walkable = false, - liquids_pointable = false, - light_source = light, - groups = groups, - drop = itemstring, - selection_box = { - type = "wallmounted", - wall_top = {-1/16, -1/16, -1/16, 1/16, 0.5, 1/16}, - wall_bottom = {-1/16, -0.5, -1/16, 1/16, 1/16, 1/16}, - }, - sounds = sounds, - node_placement_prediction = "", - on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - -- no interaction possible with entities, for now. - return itemstack - end - - local under = pointed_thing.under - local node = minetest.get_node(under) - local def = minetest.registered_nodes[node.name] - if not def then return itemstack end - - -- Call on_rightclick if the pointed node defines it - if placer and not placer:get_player_control().sneak then - if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then - return minetest.registered_nodes[node.name].on_rightclick(under, node, placer, itemstack) or itemstack - end - end - - local above = pointed_thing.above - local wdir = minetest.dir_to_wallmounted({x = under.x - above.x, y = under.y - above.y, z = under.z - above.z}) - - if check_placement_allowed(node, wdir) == false then - return itemstack - end - - local itemstring = itemstack:get_name() - local fakestack = ItemStack(itemstack) - local idef = fakestack:get_definition() - local retval - - if wdir == 1 then - retval = fakestack:set_name(itemstring) - else - retval = fakestack:set_name(itemstring_wall) - end - if not retval then - return itemstack - end - - local success - itemstack, success = minetest.item_place(fakestack, placer, pointed_thing, wdir) - itemstack:set_name(itemstring) - - if success and idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=under, gain=1}, true) - end - return itemstack - end, - on_rotate = false, - } - if moredef ~= nil then - for k,v in pairs(moredef) do - floordef[k] = v - end - end - if moredef_floor ~= nil then - for k,v in pairs(moredef_floor) do - floordef[k] = v - end - end - minetest.register_node(itemstring, floordef) - - local groups_wall = table.copy(groups) - groups_wall.torch = 2 - - local walldef = { - drawtype = "mesh", - mesh = mesh_wall, - tiles = tiles, - paramtype = "light", - paramtype2 = "wallmounted", - sunlight_propagates = true, - is_ground_content = false, - walkable = false, - light_source = light, - groups = groups_wall, - drop = itemstring, - selection_box = { - type = "wallmounted", - wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1}, - wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1}, - wall_side = {-0.5, -0.5, -0.1, -0.2, 0.1, 0.1}, - }, - sounds = sounds, - on_rotate = false, - } - if moredef ~= nil then - for k,v in pairs(moredef) do - walldef[k] = v - end - end - if moredef_wall ~= nil then - for k,v in pairs(moredef_wall) do - walldef[k] = v - end - end - minetest.register_node(itemstring_wall, walldef) - - - -- Add entry alias for the Help - if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", itemstring, "nodes", itemstring_wall) - end - -end - -mcl_torches.register_torch("soul_torch", - S("Soul Torch"), - S("Torches are light sources which can be placed at the side or on the top of most blocks."), - nil, - "soul_torch_on_floor.png", - "mcl_torches_torch_floor.obj", "mcl_torches_torch_wall.obj", - {{ +mcl_torches.register_torch({ + name = "soul_torch", + description = S("Soul Torch"), + doc_items_longdesc = S("Torches are light sources which can be placed at the side or on the top of most blocks."), + doc_items_hidden = false, + icon = "soul_torch_on_floor.png", + tiles = {{ name = "soul_torch_on_floor_animated.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} }}, - LIGHT_TORCH, - {dig_immediate=3, torch=1, deco_block=1}, - mcl_sounds.node_sound_wood_defaults(), - {_doc_items_hidden = false, - on_destruct = function(pos) - remove_flames(pos) - end}, - {on_construct = function(pos) - spawn_flames_floor(pos) - end}, - {on_construct = function(pos) - local node = minetest.get_node(pos) - spawn_flames_wall(pos, node.param2) - end}) + light = 10, + groups = {dig_immediate = 3, deco_block = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + particles = true +}) minetest.register_craft({ output = "mcl_blackstone:soul_torch 4", @@ -1101,59 +803,44 @@ minetest.register_craft({ } }) -minetest.register_lbm({ - label = "Torch flame particles", - name = "mcl_blackstone:flames", - nodenames = {"mcl_blackstone:soul_torch", "mcl_blackstone:soul_torch_wall"}, - run_at_every_load = true, - action = function(pos, node) - if node.name == "mcl_blackstone:soul_torch" then - spawn_flames_floor(pos) - elseif node.name == "mcl_blackstone:soul_torch" then - spawn_flames_wall(pos, node.param2) - end - end, -}) - - -minetest.register_node("mcl_blackstone:soul_lantern", { - tiles = { - "lantern_top.png", - "lantern_bottom.png", - "lantern.png", - "lantern.png", - "lantern.png", - "lantern.png", - }, - groups = {pickaxey=3}, - inventory_image = "lantern.png", - light_source = 10, - description = S("Soul Lantern"), - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - _mcl_hardness = 1, - node_box = { - type = "fixed", - fixed = { - {-0.1875, -0.5000, -0.1875, 0.1875, -0.06250, 0.1875}, - {-0.1250, -0.06250, -0.1250, 0.1250, 0.06250, 0.1250}, - {-0.06250, 0.1250, -0.006250, 0.06250, 0.1875, 0.006250}, - {-0.06250, 0.06250, -0.006250, -0.03125, 0.1250, 0.006250}, - {0.03125, 0.06250, -0.006250, 0.06250, 0.1250, 0.006250}, - } - }, - stack_max = 64, +minetest.register_node("mcl_blackstone:soul_lantern", { + tiles = { + "lantern_top.png", + "lantern_bottom.png", + "lantern.png", + "lantern.png", + "lantern.png", + "lantern.png", + }, + groups = {pickaxey=3}, + inventory_image = "lantern.png", + light_source = 10, + description = S("Soul Lantern"), + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + _mcl_hardness = 1, + node_box = { + type = "fixed", + fixed = { + {-0.1875, -0.5000, -0.1875, 0.1875, -0.06250, 0.1875}, + {-0.1250, -0.06250, -0.1250, 0.1250, 0.06250, 0.1250}, + {-0.06250, 0.1250, -0.006250, 0.06250, 0.1875, 0.006250}, + {-0.06250, 0.06250, -0.006250, -0.03125, 0.1250, 0.006250}, + {0.03125, 0.06250, -0.006250, 0.06250, 0.1250, 0.006250}, + } + }, + stack_max = 64, }) minetest.register_craft({ - type = "shaped", - output = "mcl_blackstone:soul_lantern", - recipe = { - {"mcl_core:iron_nugget", "mcl_core:iron_nugget","mcl_core:iron_nugget"}, - {"mcl_core:iron_nugget", "mcl_blackstone:soul_torch", "mcl_core:iron_nugget"}, - {"mcl_core:iron_nugget", "mcl_core:iron_nugget", "mcl_core:iron_nugget"} - } + type = "shaped", + output = "mcl_blackstone:soul_lantern", + recipe = { + {"mcl_core:iron_nugget", "mcl_core:iron_nugget","mcl_core:iron_nugget"}, + {"mcl_core:iron_nugget", "mcl_blackstone:soul_torch", "mcl_core:iron_nugget"}, + {"mcl_core:iron_nugget", "mcl_core:iron_nugget", "mcl_core:iron_nugget"} + } }) diff --git a/mods/ITEMS/mcl_blackstone/textures/mcl_blackstone.png b/mods/ITEMS/mcl_blackstone/textures/mcl_blackstone_side.png similarity index 100% rename from mods/ITEMS/mcl_blackstone/textures/mcl_blackstone.png rename to mods/ITEMS/mcl_blackstone/textures/mcl_blackstone_side.png diff --git a/mods/ITEMS/mcl_blackstone/textures/mcl_blackstone_top.png b/mods/ITEMS/mcl_blackstone/textures/mcl_blackstone_top.png new file mode 100644 index 000000000..a811c6940 Binary files /dev/null and b/mods/ITEMS/mcl_blackstone/textures/mcl_blackstone_top.png differ diff --git a/mods/ITEMS/mcl_books/init.lua b/mods/ITEMS/mcl_books/init.lua index 5101994e9..95b45e69e 100644 --- a/mods/ITEMS/mcl_books/init.lua +++ b/mods/ITEMS/mcl_books/init.lua @@ -147,8 +147,8 @@ minetest.register_on_player_receive_fields(function ( player, formname, fields ) local formspec = "size[8,9]".. header.. "background[-0.5,-0.5;9,10;mcl_books_book_bg.png]".. - "field[0.75,1;7.25,1;title;"..minetest.formspec_escape(minetest.colorize(mcl_colors.BLACK, S("Enter book title:")))..";]".. - "label[0.75,1.5;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("by @1", name))).."]".. + "field[0.75,1;7.25,1;title;"..minetest.formspec_escape(minetest.colorize("#000000", S("Enter book title:")))..";]".. + "label[0.75,1.5;"..minetest.formspec_escape(minetest.colorize("#404040", S("by @1", name))).."]".. "button_exit[0.75,7.95;3,1;sign;"..minetest.formspec_escape(S("Sign and Close")).."]".. "tooltip[sign;"..minetest.formspec_escape(S("Note: The book will no longer be editable after signing")).."]".. "button[4.25,7.95;3,1;cancel;"..minetest.formspec_escape(S("Cancel")).."]" diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 78ccd8ed9..617929ff7 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -4,8 +4,8 @@ local function active_brewing_formspec(fuel_percent, brew_percent) return "size[9,8.75]".. "background[-0.19,-0.25;9.5,9.5;mcl_brewing_inventory.png]".. - "label[4,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Brewing Stand"))).."]".. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[4,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Brewing Stand"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.75;9,1;]".. @@ -35,8 +35,8 @@ end local brewing_formspec = "size[9,8.75]".. "background[-0.19,-0.25;9.5,9.5;mcl_brewing_inventory.png]".. - "label[4,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Brewing Stand"))).."]".. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[4,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Brewing Stand"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.75;9,1;]".. diff --git a/mods/ITEMS/mcl_brewing/mod.conf b/mods/ITEMS/mcl_brewing/mod.conf index 160319c93..2c27c979e 100644 --- a/mods/ITEMS/mcl_brewing/mod.conf +++ b/mods/ITEMS/mcl_brewing/mod.conf @@ -1,4 +1,4 @@ name = mcl_brewing author = bzoss -depends = mcl_init, mcl_formspec, mcl_sounds, mcl_potions, mcl_mobitems, mcl_colors +depends = mcl_init, mcl_formspec, mcl_sounds, mcl_potions, mcl_mobitems optional_depends = mcl_core, doc, screwdriver diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 1f3f518a4..824530eb3 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -475,10 +475,10 @@ minetest.register_node(small_name, { minetest.show_formspec(clicker:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,8.75]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. @@ -624,12 +624,12 @@ minetest.register_node(left_name, { minetest.show_formspec(clicker:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,11.5]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. "list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,3.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,3.5,9,3).. - "label[0,7;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,7;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,7.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,7.5,9,3).. "list[current_player;main;0,10.75;9,1;]".. @@ -773,12 +773,12 @@ minetest.register_node("mcl_chests:"..basename.."_right", { "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,11.5]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,3.5,9,3).. - "label[0,7;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,7;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,7.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,7.5,9,3).. "list[current_player;main;0,10.75;9,1;]".. @@ -986,10 +986,10 @@ minetest.register_node("mcl_chests:ender_chest", { }) local formspec_ender_chest = "size[9,8.75]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Ender Chest"))).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Ender Chest"))).."]".. "list[current_player;enderchest;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. @@ -1027,11 +1027,14 @@ minetest.register_node("mcl_chests:ender_chest_small", { sounds = mcl_sounds.node_sound_stone_defaults(), drop = "mcl_core:obsidian 8", on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", formspec_ender_chest) create_entity(pos, "mcl_chests:ender_chest_small", {"mcl_chests_ender.png"}, minetest.get_node(pos).param2, false, "mcl_chests_enderchest", "mcl_chests_chest", "chest") end, on_rightclick = function(pos, node, clicker) + if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name].groups.opaque == 1 then + -- won't open if there is no space from the top + return false + end + minetest.show_formspec(clicker:get_player_name(), "mcl_chests:ender_chest_"..clicker:get_player_name(), formspec_ender_chest) player_chest_open(clicker, pos, "mcl_chests:ender_chest_small", {"mcl_chests_ender.png"}, node.param2, false, "mcl_chests_enderchest", "mcl_chests_chest") end, on_receive_fields = function(pos, formname, fields, sender) @@ -1104,10 +1107,10 @@ local function formspec_shulker_box(name) name = S("Shulker Box") end return "size[9,8.75]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, name)).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[current_name;main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. - "label[0,4.0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. @@ -1406,3 +1409,13 @@ minetest.register_lbm({ meta:set_string("formspec", formspec_shulker_box) end, }) + +minetest.register_lbm({ + label = "Upgrade old ender chest formspec", + name = "mcl_chests:replace_old_ender_form", + nodenames = {"mcl_chests:ender_chest_small"}, + run_at_every_load = false, + action = function(pos, node) + minetest.get_meta(pos):set_string("formspec", "") + end, +}) diff --git a/mods/ITEMS/mcl_chests/mod.conf b/mods/ITEMS/mcl_chests/mod.conf index 609b1fff9..0ff5129ca 100644 --- a/mods/ITEMS/mcl_chests/mod.conf +++ b/mods/ITEMS/mcl_chests/mod.conf @@ -1,3 +1,3 @@ name = mcl_chests -depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_end, mesecons, mcl_colors +depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_end, mesecons optional_depends = doc, screwdriver diff --git a/mods/ITEMS/mcl_compass/locale/mcl_compass.de.tr b/mods/ITEMS/mcl_compass/locale/mcl_compass.de.tr index a78b70c01..cf4c814ce 100644 --- a/mods/ITEMS/mcl_compass/locale/mcl_compass.de.tr +++ b/mods/ITEMS/mcl_compass/locale/mcl_compass.de.tr @@ -1,4 +1,4 @@ # textdomain: mcl_compass -Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.=Kompasse sind Werkzeuge, die zum Ursprungspunkt der Welt (X@=0, Z@=0) oder den Einstiegspunkt der Welt zeigen. +Compasses are tools which point to the world origin (X@=0, Z@=0) or the spawn point in the Overworld.=Kompasse sind Werkzeuge, die zum Ursprungspunkt der Welt (X@=0, Z@=0) oder zum Einstiegspunkt der Welt zeigen. Compass=Kompass Points to the world origin=Zeigt zum Startpunkt der Welt diff --git a/mods/ITEMS/mcl_core/crafting.lua b/mods/ITEMS/mcl_core/crafting.lua index 7a2b6a5c8..a0ad38a77 100644 --- a/mods/ITEMS/mcl_core/crafting.lua +++ b/mods/ITEMS/mcl_core/crafting.lua @@ -46,56 +46,6 @@ minetest.register_craft({ } }) --- Stripped Bark -minetest.register_craft({ - output = "mcl_core:stripped_oak_bark 3", - recipe = { - { "mcl_core:stripped_oak", "mcl_core:stripped_oak" }, - { "mcl_core:stripped_oak", "mcl_core:stripped_oak" }, - } -}) - -minetest.register_craft({ - output = "mcl_core:stripped_acacia_bark 3", - recipe = { - { "mcl_core:stripped_acacia", "mcl_core:stripped_acacia" }, - { "mcl_core:stripped_acacia", "mcl_core:stripped_acacia" }, - } -}) - -minetest.register_craft({ - output = "mcl_core:stripped_dark_oak_bark 3", - recipe = { - { "mcl_core:stripped_dark_oak", "mcl_core:stripped_dark_oak" }, - { "mcl_core:stripped_dark_oak", "mcl_core:stripped_dark_oak" }, - } -}) - -minetest.register_craft({ - output = "mcl_core:stripped_birch_bark 3", - recipe = { - { "mcl_core:stripped_birch", "mcl_core:stripped_birch" }, - { "mcl_core:stripped_birch", "mcl_core:stripped_birch" }, - } -}) - -minetest.register_craft({ - output = "mcl_core:stripped_spruce_bark 3", - recipe = { - { "mcl_core:stripped_spruce", "mcl_core:stripped_spruce" }, - { "mcl_core:stripped_spruce", "mcl_core:stripped_spruce" }, - } -}) - -minetest.register_craft({ - output = "mcl_core:stripped_jungle_bark 3", - recipe = { - { "mcl_core:stripped_jungle", "mcl_core:stripped_jungle" }, - { "mcl_core:stripped_jungle", "mcl_core:stripped_jungle" }, - } -}) - - minetest.register_craft({ type = 'shapeless', output = 'mcl_core:mossycobble', diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 0c25de94f..732c386b0 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -190,6 +190,22 @@ minetest.register_abm({ end, }) +-- Make cactus destroy items +minetest.register_abm({ + label = "Cactus destroy items", + nodenames = {"mcl_core:cactus"}, + interval = 1, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + for _,object in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do + if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then + object:remove() + end + end + end, +}) + + minetest.register_abm({ label = "Sugar canes growth", nodenames = {"mcl_core:reeds"}, diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index 4af3eef34..801810dbd 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -8,7 +8,7 @@ if mod_screwdriver then end -- Register tree trunk (wood) and bark -local register_tree_trunk = function(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark) +local register_tree_trunk = function(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_varient) minetest.register_node("mcl_core:"..subname, { description = description_trunk, _doc_items_longdesc = longdesc, @@ -22,6 +22,7 @@ local register_tree_trunk = function(subname, description_trunk, description_bar on_rotate = on_rotate, _mcl_blast_resistance = 2, _mcl_hardness = 2, + _mcl_stripped_varient = stripped_varient, }) minetest.register_node("mcl_core:"..subname.."_bark", { @@ -37,6 +38,7 @@ local register_tree_trunk = function(subname, description_trunk, description_bar on_rotate = on_rotate, _mcl_blast_resistance = 2, _mcl_hardness = 2, + _mcl_stripped_varient = stripped_varient.."_bark", }) minetest.register_craft({ @@ -48,165 +50,46 @@ local register_tree_trunk = function(subname, description_trunk, description_bar }) end --- Register stripped trunk -minetest.register_node("mcl_core:stripped_oak", { - description = "Stripped Oak Log", - _doc_items_longdesc = "Stripped Oak Log is a log that has been stripped of it's bark.", - tiles = {"mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_acacia", { - description = "Stripped Acacia Log", - _doc_items_longdesc = "Stripped Acacia Log is a log that has been stripped of it's bark.", - tiles = {"mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_dark_oak", { - description = "Stripped Dark Oak Log", - _doc_items_longdesc = "Stripped Dark Oak Log is a log that has been stripped of it's bark.", - tiles = {"mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_birch", { - description = "Stripped Birch Log", - _doc_items_longdesc = "Stripped Birch Log is a log that has been stripped of it's bark.", - tiles = {"mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_spruce", { - description = "Stripped Spruce Log", - _doc_items_longdesc = "Stripped Spruce Log is a log that has been stripped of it's bark.", - tiles = {"mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_jungle", { - description = "Stripped Jungle Log", - _doc_items_longdesc = "Stripped Jungle Log is a log that has been stripped of it's bark.", - tiles = {"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5, tree=1}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - - --- Register stripped bark -minetest.register_node("mcl_core:stripped_oak_bark", { - description = "Stripped Oak Bark", - _doc_items_longdesc = "Stripped Oak Bark is a bark that has been stripped.", - tiles = {"mcl_core_stripped_oak_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_acacia_bark", { - description = "Stripped Acacia Bark", - _doc_items_longdesc = "Stripped Acacia Bark is a bark that has been stripped.", - tiles = {"mcl_core_stripped_acacia_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_dark_oak_bark", { - description = "Stripped Dark Oak Bark", - _doc_items_longdesc = "Stripped Dark Oak Bark is a bark that has been stripped.", - tiles = {"mcl_core_stripped_dark_oak_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_birch_bark", { - description = "Stripped Birch Bark", - _doc_items_longdesc = "Stripped Birch Bark is a bark that has been stripped.", - tiles = {"mcl_core_stripped_birch_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_spruce_bark", { - description = "Stripped Spruce Bark", - _doc_items_longdesc = "Stripped Spruce Bark is a bark that has been stripped.", - tiles = {"mcl_core_stripped_spruce_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) - -minetest.register_node("mcl_core:stripped_jungle_bark", { - description = "Stripped Jungle Bark", - _doc_items_longdesc = "Stripped Jungles Bark is a bark that has been stripped.", - tiles = {"mcl_core_stripped_jungle_side.png"}, - is_ground_content = false, - paramtype2 = "facedir", - on_place = mcl_util.rotate_axis, - groups = {handy=1,axey=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 10, - _mcl_hardness = 2, -}) +-- Register stripped trunk and stripped wood +local register_stripped_trunk = function(subname, description_stripped_trunk, description_stripped_bark, longdesc, tile_stripped_inner, tile_stripped_bark) + minetest.register_node("mcl_core:"..subname, { + description = description_stripped_trunk, + _doc_items_longdesc = longdesc, + _doc_items_hidden = false, + tiles = {tile_stripped_inner, tile_stripped_inner, tile_stripped_bark}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1,axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, + sounds = mcl_sounds.node_sound_wood_defaults(), + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + }) + minetest.register_node("mcl_core:"..subname.."_bark", { + description = description_stripped_bark, + _doc_items_longdesc = S("This is a decorative block."), + tiles = {tile_stripped_bark}, + paramtype2 = "facedir", + on_place = mcl_util.rotate_axis, + stack_max = 64, + groups = {handy=1,axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, + sounds = mcl_sounds.node_sound_wood_defaults(), + is_ground_content = false, + on_rotate = on_rotate, + _mcl_blast_resistance = 2, + _mcl_hardness = 2, + }) + + minetest.register_craft({ + output = "mcl_core:"..subname.."_bark 3", + recipe = { + { "mcl_core:"..subname, "mcl_core:"..subname }, + { "mcl_core:"..subname, "mcl_core:"..subname }, + } + }) +end local register_wooden_planks = function(subname, description, tiles) minetest.register_node("mcl_core:"..subname, { @@ -333,12 +216,19 @@ end --------------------- -register_tree_trunk("tree", S("Oak Wood"), S("Oak Bark"), S("The trunk of an oak tree."), "default_tree_top.png", "default_tree.png") -register_tree_trunk("darktree", S("Dark Oak Wood"), S("Dark Oak Bark"), S("The trunk of a dark oak tree."), "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png") -register_tree_trunk("acaciatree", S("Acacia Wood"), S("Acacia Bark"), S("The trunk of an acacia."), "default_acacia_tree_top.png", "default_acacia_tree.png") -register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The trunk of a spruce tree."), "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png") -register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png") -register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png") +register_tree_trunk("tree", S("Oak Wood"), S("Oak Bark"), S("The trunk of an oak tree."), "default_tree_top.png", "default_tree.png", "mcl_core:stripped_oak") +register_tree_trunk("darktree", S("Dark Oak Wood"), S("Dark Oak Bark"), S("The trunk of a dark oak tree."), "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png", "mcl_core:stripped_dark_oak") +register_tree_trunk("acaciatree", S("Acacia Wood"), S("Acacia Bark"), S("The trunk of an acacia."), "default_acacia_tree_top.png", "default_acacia_tree.png", "mcl_core:stripped_acacia") +register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The trunk of a spruce tree."), "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png", "mcl_core:stripped_spruce") +register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png", "mcl_core:stripped_birch") +register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png", "mcl_core:stripped_jungle") + +register_stripped_trunk("stripped_oak", S("Stripped Oak Log"), S("Stripped Oak Wood"), S("The stripped trunk of an oak tree."), "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png") +register_stripped_trunk("stripped_acacia", S("Stripped Acacia Log"), S("Stripped Acacia Wood"), S("The stripped trunk of an acacia tree."), "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png") +register_stripped_trunk("stripped_dark_oak", S("Stripped Dark Oak Log"), S("Stripped Dark Oak Wood"), S("The stripped trunk of an dark oak tree."), "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png") +register_stripped_trunk("stripped_birch", S("Stripped Birch Log"), S("Stripped Birch Wood"), S("The stripped trunk of an birch tree."), "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png") +register_stripped_trunk("stripped_spruce", S("Stripped Spruce Log"), S("Stripped Spruce Wood"), S("The stripped trunk of an spruce tree."), "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png") +register_stripped_trunk("stripped_jungle", S("Stripped Jungle Log"), S("Stripped Jungle Wood"), S("The stripped trunk of an jungle tree."),"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png") register_wooden_planks("wood", S("Oak Wood Planks"), {"default_wood.png"}) register_wooden_planks("darkwood", S("Dark Oak Wood Planks"), {"mcl_core_planks_big_oak.png"}) diff --git a/mods/ITEMS/mcl_crafting_table/init.lua b/mods/ITEMS/mcl_crafting_table/init.lua index 6df4c2544..cbf1cff34 100644 --- a/mods/ITEMS/mcl_crafting_table/init.lua +++ b/mods/ITEMS/mcl_crafting_table/init.lua @@ -2,7 +2,7 @@ local S = minetest.get_translator("mcl_crafting_table") local formspec_escape = minetest.formspec_escape local show_formspec = minetest.show_formspec local C = minetest.colorize -local text_color = mcl_colors.DARK_GRAY +local text_color = "#313131" local itemslot_bg = mcl_formspec.get_itemslot_bg mcl_crafting_table = {} diff --git a/mods/ITEMS/mcl_doors/api_doors.lua b/mods/ITEMS/mcl_doors/api_doors.lua index f3dd0f469..909bb47e4 100644 --- a/mods/ITEMS/mcl_doors/api_doors.lua +++ b/mods/ITEMS/mcl_doors/api_doors.lua @@ -1,4 +1,5 @@ local S = minetest.get_translator("mcl_doors") +local minetest_get_meta = minetest.get_meta -- This helper function calls on_place_node callbacks. local function on_place_node(place_to, newnode, @@ -164,14 +165,14 @@ function mcl_doors:register_door(name, def) end if def.only_placer_can_open then - local meta = minetest.get_meta(pt) + local meta = minetest_get_meta(pt) meta:set_string("doors_owner", "") - meta = minetest.get_meta(pt2) + meta = minetest_get_meta(pt2) meta:set_string("doors_owner", "") end - local meta1 = minetest.get_meta(pt) - local meta2 = minetest.get_meta(pt2) + local meta1 = minetest_get_meta(pt) + local meta2 = minetest_get_meta(pt2) -- save mirror state for the correct door if left_node.name:sub(1, #name) == name then meta1:set_int("is_mirrored", 1) @@ -198,9 +199,9 @@ function mcl_doors:register_door(name, def) local tb = def.tiles_bottom local function on_open_close(pos, dir, check_name, replace, replace_dir) - local meta1 = minetest.get_meta(pos) + local meta1 = minetest_get_meta(pos) pos.y = pos.y+dir - local meta2 = minetest.get_meta(pos) + local meta2 = minetest_get_meta(pos) -- if name of other door is not the same as check_name -> return if not minetest.get_node(pos).name == check_name then @@ -254,7 +255,7 @@ function mcl_doors:register_door(name, def) if not def.only_placer_can_open then return true end - local meta = minetest.get_meta(pos) + local meta = minetest_get_meta(pos) local pn = player:get_player_name() return meta:get_string("doors_owner") == pn end @@ -292,10 +293,15 @@ function mcl_doors:register_door(name, def) sounds = def.sounds, after_destruct = function(bottom, oldnode) - minetest.add_item(bottom, name) - local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z } - if minetest.get_node(bottom).name ~= name.."_b_2" and minetest.get_node(top).name == name.."_t_1" then - minetest.remove_node(top) + local meta_bottom = minetest_get_meta(bottom) + if meta_bottom:get_int("rotation") == 1 then + meta_bottom:set_int("rotation", 0) + else + minetest.add_item(bottom, name) + local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z } + if minetest.get_node(bottom).name ~= name.."_b_2" and minetest.get_node(top).name == name.."_t_1" then + minetest.remove_node(top) + end end end, @@ -305,13 +311,19 @@ function mcl_doors:register_door(name, def) action_on = on_mesecons_signal_open, }}, - on_rotate = function(pos, node, user, mode, param2) + on_rotate = function(bottom, node, user, mode, param2) if mode == screwdriver.ROTATE_FACE then - minetest.remove_node(pos) - node.param2 = screwdriver.rotate.facedir(pos, node, mode) - minetest.set_node(pos, node) + local meta_bottom = minetest_get_meta(bottom) + meta_bottom:set_int("rotation", 1) + node.param2 = screwdriver.rotate.facedir(bottom, node, mode) + minetest.swap_node(bottom, node) + + local top = {x=bottom.x,y=bottom.y+1,z=bottom.z} + local meta_top = minetest_get_meta(top) + meta_top:set_int("rotation", 1) node.name = name .."_t_1" - minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, node) + minetest.swap_node(top, node) + return true end return false @@ -353,9 +365,14 @@ function mcl_doors:register_door(name, def) sounds = def.sounds, after_destruct = function(top, oldnode) - local bottom = { x = top.x, y = top.y - 1, z = top.z } - if minetest.get_node(top).name ~= name.."_t_2" and minetest.get_node(bottom).name == name.."_b_1" and oldnode.name == name.."_t_1" then - minetest.dig_node(bottom) + local meta_top = minetest_get_meta(top) + if meta_top:get_int("rotation") == 1 then + meta_top:set_int("rotation", 0) + else + local bottom = { x = top.x, y = top.y - 1, z = top.z } + if minetest.get_node(top).name ~= name.."_t_2" and minetest.get_node(bottom).name == name.."_b_1" and oldnode.name == name.."_t_1" then + minetest.dig_node(bottom) + end end end, @@ -366,13 +383,19 @@ function mcl_doors:register_door(name, def) rules = mesecon.rules.flat, }}, - on_rotate = function(pos, node, user, mode, param2) + on_rotate = function(top, node, user, mode, param2) if mode == screwdriver.ROTATE_FACE then - minetest.remove_node(pos) - node.param2 = screwdriver.rotate.facedir(pos, node, mode) - minetest.set_node(pos, node) + local meta_top = minetest_get_meta(top) + meta_top:set_int("rotation", 1) + node.param2 = screwdriver.rotate.facedir(top, node, mode) + minetest.swap_node(top, node) + + local bottom = {x=top.x,y=top.y-1,z=top.z} + local meta_bottom = minetest_get_meta(bottom) + meta_bottom:set_int("rotation", 1) node.name = name .."_b_1" - minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z}, node) + minetest.swap_node(bottom, node) + return true end return false @@ -414,10 +437,15 @@ function mcl_doors:register_door(name, def) sounds = def.sounds, after_destruct = function(bottom, oldnode) - minetest.add_item(bottom, name) - local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z } - if minetest.get_node(bottom).name ~= name.."_b_1" and minetest.get_node(top).name == name.."_t_2" then - minetest.remove_node(top) + local meta_bottom = minetest_get_meta(bottom) + if meta_bottom:get_int("rotation") == 1 then + meta_bottom:set_int("rotation", 0) + else + local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z } + minetest.add_item(bottom, name) + if minetest.get_node(bottom).name ~= name.."_b_1" and minetest.get_node(top).name == name.."_t_2" then + minetest.remove_node(top) + end end end, @@ -427,13 +455,19 @@ function mcl_doors:register_door(name, def) action_off = on_mesecons_signal_close, }}, - on_rotate = function(pos, node, user, mode, param2) + on_rotate = function(bottom, node, user, mode, param2) if mode == screwdriver.ROTATE_FACE then - minetest.remove_node(pos) - node.param2 = screwdriver.rotate.facedir(pos, node, mode) - minetest.set_node(pos, node) + local meta_bottom = minetest_get_meta(bottom) + meta_bottom:set_int("rotation", 1) + node.param2 = screwdriver.rotate.facedir(bottom, node, mode) + minetest.swap_node(bottom, node) + + local top = {x=bottom.x,y=bottom.y+1,z=bottom.z} + local meta_top = minetest_get_meta(top) + meta_top:set_int("rotation", 1) node.name = name .."_t_2" - minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, node) + minetest.swap_node(top, node) + return true end return false @@ -475,9 +509,14 @@ function mcl_doors:register_door(name, def) sounds = def.sounds, after_destruct = function(top, oldnode) - local bottom = { x = top.x, y = top.y - 1, z = top.z } - if minetest.get_node(top).name ~= name.."_t_1" and minetest.get_node(bottom).name == name.."_b_2" and oldnode.name == name.."_t_2" then - minetest.dig_node(bottom) + local meta_top = minetest_get_meta(top) + if meta_top:get_int("rotation") == 1 then + meta_top:set_int("rotation", 0) + else + local bottom = { x = top.x, y = top.y - 1, z = top.z } + if minetest.get_node(top).name ~= name.."_t_1" and minetest.get_node(bottom).name == name.."_b_2" and oldnode.name == name.."_t_2" then + minetest.dig_node(bottom) + end end end, @@ -488,13 +527,19 @@ function mcl_doors:register_door(name, def) rules = mesecon.rules.flat, }}, - on_rotate = function(pos, node, user, mode, param2) + on_rotate = function(top, node, user, mode, param2) if mode == screwdriver.ROTATE_FACE then - minetest.remove_node(pos) - node.param2 = screwdriver.rotate.facedir(pos, node, mode) - minetest.set_node(pos, node) + local meta_top = minetest_get_meta(top) + meta_top:set_int("rotation", 1) + node.param2 = screwdriver.rotate.facedir(top, node, mode) + minetest.swap_node(top, node) + + local bottom = {x=top.x,y=top.y-1,z=top.z} + local meta_bottom = minetest_get_meta(bottom) + meta_bottom:set_int("rotation", 1) node.name = name .."_b_2" - minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z}, node) + minetest.swap_node(bottom, node) + return true end return false diff --git a/mods/ITEMS/mcl_doors/locale/mcl_doors.de.tr b/mods/ITEMS/mcl_doors/locale/mcl_doors.de.tr index 03be49a68..be88513cb 100644 --- a/mods/ITEMS/mcl_doors/locale/mcl_doors.de.tr +++ b/mods/ITEMS/mcl_doors/locale/mcl_doors.de.tr @@ -16,9 +16,9 @@ Birch Trapdoor=Birkenfalltür Spruce Trapdoor=Fichtenfalltür Dark Oak Trapdoor=Schwarzeichenfalltür Jungle Trapdoor=Dschungelfalltür -Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.=Holzfalltüren sind horizontale Barrieren, die von Hand oder mit einem Redstone-Signal geöffnet oder geschlossen werden können. Sie belegen den oberen oder unteren Teil eines Blocks, je nach dem, wie sie platziert wurden. Wenn geöffnet, können sie wie eine Leiter erklommen werden. +Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.=Holzfalltüren sind horizontale Barrieren, die von Hand oder mit einem Redstone-Signal geöffnet oder geschlossen werden können. Sie belegen den oberen oder unteren Teil eines Blocks, je nachdem, wie sie platziert wurden. Wenn geöffnet, können sie wie eine Leiter erklommen werden. To open or close the trapdoor, rightclick it or send a redstone signal to it.=Um die Falltür zu öffnen oder zu schließen, rechtsklicken Sie sie oder schicken Sie ein Redstone-Signal zu ihr. Iron Trapdoor=Eisenfalltür -Iron trapdoors are horizontal barriers which can only be opened and closed by redstone signals, but not by hand. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.=Eisenfalltüren sind horizontale Barrieren, die nur mit einem Redstone-Signal geöffnet oder geschlossen werden können, nicht von Hand. Sie belegen den oberen oder unteren Teil eines Blocks, je nach dem, wie sie platziert wurden. Wenn geöffnet, können sie wie eine Leiter erklommen werden. +Iron trapdoors are horizontal barriers which can only be opened and closed by redstone signals, but not by hand. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.=Eisenfalltüren sind horizontale Barrieren, die nur mit einem Redstone-Signal geöffnet oder geschlossen werden können, nicht von Hand. Sie belegen den oberen oder unteren Teil eines Blocks, je nachdem, wie sie platziert wurden. Wenn geöffnet, können sie wie eine Leiter erklommen werden. Openable by players and redstone power=Zu öffnen von Spielern und Redstoneenergie Openable by redstone power=Zu öffnen von Redstoneenergie diff --git a/mods/ITEMS/mcl_enchanting/enchantments.lua b/mods/ITEMS/mcl_enchanting/enchantments.lua index ca936c319..fa3bc3ed5 100644 --- a/mods/ITEMS/mcl_enchanting/enchantments.lua +++ b/mods/ITEMS/mcl_enchanting/enchantments.lua @@ -770,12 +770,17 @@ mcl_enchanting.enchantments.unbreaking = { description = S("Increases item durability."), curse = false, on_enchant = function(itemstack, level) - local tool_capabilities = itemstack:get_tool_capabilities() - for group, capability in pairs(tool_capabilities.groupcaps) do - capability.uses = capability.uses * (1 + level) + local name = itemstack:get_name() + if not minetest.registered_tools[name].tool_capabilities then + return end + + local tool_capabilities = itemstack:get_tool_capabilities() tool_capabilities.punch_attack_uses = tool_capabilities.punch_attack_uses * (1 + level) itemstack:get_meta():set_tool_capabilities(tool_capabilities) + + -- Unbreaking for groupcaps is handled in this function. + mcl_enchanting.update_groupcaps(itemstack) end, requires_tool = true, treasure = false, diff --git a/mods/ITEMS/mcl_enchanting/engine.lua b/mods/ITEMS/mcl_enchanting/engine.lua index ea69d1868..3243b7879 100644 --- a/mods/ITEMS/mcl_enchanting/engine.lua +++ b/mods/ITEMS/mcl_enchanting/engine.lua @@ -12,11 +12,12 @@ end function mcl_enchanting.unload_enchantments(itemstack) local itemdef = itemstack:get_definition() if itemdef.tool_capabilities then - itemstack:get_meta():set_tool_capabilities(itemdef.tool_capabilities) + itemstack:get_meta():set_tool_capabilities(nil) end local meta = itemstack:get_meta() if meta:get_string("name") == "" then meta:set_string("description", "") + meta:set_string("groupcaps_hash", "") end end @@ -468,13 +469,13 @@ function mcl_enchanting.show_enchanting_formspec(player) local formspec = "" .. "size[9.07,8.6;]" .. "formspec_version[3]" - .. "label[0,0;" .. C(mcl_colors.DARK_GRAY) .. F(table_name) .. "]" + .. "label[0,0;" .. C("#313131") .. F(table_name) .. "]" .. mcl_formspec.get_itemslot_bg(0.2, 2.4, 1, 1) .. "list[current_player;enchanting_item;0.2,2.4;1,1]" .. mcl_formspec.get_itemslot_bg(1.1, 2.4, 1, 1) .. "image[1.1,2.4;1,1;mcl_enchanting_lapis_background.png]" .. "list[current_player;enchanting_lapis;1.1,2.4;1,1]" - .. "label[0,4;" .. C(mcl_colors.DARK_GRAY) .. F(S("Inventory")).."]" + .. "label[0,4;" .. C("#313131") .. F(S("Inventory")).."]" .. mcl_formspec.get_itemslot_bg(0, 4.5, 9, 3) .. mcl_formspec.get_itemslot_bg(0, 7.74, 9, 1) .. "list[current_player;main;0,4.5;9,3;9]" @@ -501,11 +502,11 @@ function mcl_enchanting.show_enchanting_formspec(player) local hover_ending = (can_enchant and "_hovered" or "_off") formspec = formspec .. "container[3.2," .. y .. "]" - .. (slot and "tooltip[button_" .. i .. ";" .. C(mcl_colors.GRAY) .. F(slot.description) .. " " .. C(mcl_colors.WHITE) .. " . . . ?\n\n" .. (enough_levels and C(enough_lapis and mcl_colors.GRAY or mcl_colors.RED) .. F(S("@1 Lapis Lazuli", i)) .. "\n" .. C(mcl_colors.GRAY) .. F(S("@1 Enchantment Levels", i)) or C(mcl_colors.RED) .. F(S("Level requirement: @1", slot.level_requirement))) .. "]" or "") + .. (slot and "tooltip[button_" .. i .. ";" .. C("#818181") .. ((slot.description and F(slot.description)) or "") .. " " .. C("#FFFFFF") .. " . . . ?\n\n" .. (enough_levels and C(enough_lapis and "#818181" or "#FC5454") .. F(S("@1 Lapis Lazuli", i)) .. "\n" .. C("#818181") .. F(S("@1 Enchantment Levels", i)) or C("#FC5454") .. F(S("Level requirement: @1", slot.level_requirement))) .. "]" or "") .. "style[button_" .. i .. ";bgimg=mcl_enchanting_button" .. ending .. ".png;bgimg_hovered=mcl_enchanting_button" .. hover_ending .. ".png;bgimg_pressed=mcl_enchanting_button" .. hover_ending .. ".png]" .. "button[0,0;7.5,1.3;button_" .. i .. ";]" .. (slot and "image[0,0;1.3,1.3;mcl_enchanting_number_" .. i .. ending .. ".png]" or "") - .. (slot and "label[7.2,1.1;" .. C(can_enchant and mcl_colors.GREEN or mcl_colors.DARK_GREEN) .. slot.level_requirement .. "]" or "") + .. (slot and "label[7.2,1.1;" .. C(can_enchant and "#80FF20" or "#407F10") .. slot.level_requirement .. "]" or "") .. (slot and slot.glyphs or "") .. "container_end[]" y = y + 1.35 diff --git a/mods/ITEMS/mcl_enchanting/groupcaps.lua b/mods/ITEMS/mcl_enchanting/groupcaps.lua index 375029547..0bc1b8e24 100644 --- a/mods/ITEMS/mcl_enchanting/groupcaps.lua +++ b/mods/ITEMS/mcl_enchanting/groupcaps.lua @@ -45,18 +45,30 @@ end -- To make it more efficient it will first check a hash value to determine if -- the tool needs to be updated. function mcl_enchanting.update_groupcaps(itemstack) - if not itemstack:get_meta():get("tool_capabilities") then + local name = itemstack:get_name() + if not minetest.registered_tools[name].tool_capabilities then return end - local name = itemstack:get_name() - local level = mcl_enchanting.get_enchantment(itemstack, "efficiency") - local groupcaps = get_efficiency_groupcaps(name, level) + local efficiency = mcl_enchanting.get_enchantment(itemstack, "efficiency") + local unbreaking = mcl_enchanting.get_enchantment(itemstack, "unbreaking") + if unbreaking == 0 and efficiency == 0 then + return + end + + local groupcaps = get_efficiency_groupcaps(name, efficiency) local hash = itemstack:get_meta():get_string("groupcaps_hash") if not hash or hash ~= groupcaps.hash then local tool_capabilities = itemstack:get_tool_capabilities() tool_capabilities.groupcaps = groupcaps.values + + -- Increase the number of uses depending on the unbreaking level + -- of the tool. + for group, capability in pairs(tool_capabilities.groupcaps) do + capability.uses = capability.uses * (1 + unbreaking) + end + itemstack:get_meta():set_tool_capabilities(tool_capabilities) itemstack:get_meta():set_string("groupcaps_hash", groupcaps.hash) end diff --git a/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.de.tr b/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.de.tr index 68077578c..ecc08b5dc 100644 --- a/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.de.tr +++ b/mods/ITEMS/mcl_enchanting/locale/mcl_enchanting.de.tr @@ -17,8 +17,8 @@ Efficiency=Effizienz Increases mining speed.=Erhöht Grabegeschwindigkeit. Feather Falling=Federfall Reduces fall damage.=Reduziert Fallschaden. -Fire Aspect=Feieraspekt -Sets target on fire.=Zündes das Ziel an. +Fire Aspect=Feueraspekt +Sets target on fire.=Zündet das Ziel an. Fire Protection=Feuerschutz Reduces fire damage.=Reduziert Feuerschaden Flame=Flamme @@ -31,7 +31,7 @@ Impaling=Aufspießen Trident deals additional damage to ocean mobs.=Dreizack richtet Zusatzschaden an Ozeanmobs an. Infinity=Unendlichkeit Shooting consumes no regular arrows.=Schüsse verbrauchen keine regulären Pfeile. -Knockback=Rückschlag. +Knockback=Rückschlag Increases knockback.=Verstärkt Rückschlag. Looting=Plünderer Increases mob loot.=Erhöht Abwürfe von Mobs. @@ -43,7 +43,7 @@ Lure=Köder Decreases time until rod catches something.=Reduziert die Zeit, bis die Angel etwas fängt. Mending=Ausbessern Repair the item while gaining XP orbs.=Gegenstand reparieren, während man Erfahrungskugeln erhält. -Multishot=Mehrschuss +Multishot=Mehrfachschuss Shoot 3 arrows at the cost of one.=3 Pfeile zum Preis von 1 schießen. Piercing=Durchbohren Arrows passes through multiple objects.=Pfeile durchdringen mehrere Objekte. @@ -74,7 +74,7 @@ Increases sweeping attack damage.=Erhöht Schwungangriffsschaden. Thorns=Dornen Reflects some of the damage taken when hit, at the cost of reducing durability with each proc.=Reflektiert etwas des Schadens beim Erleiden eines Treffers, auf Kosten der Haltbarkeit. Unbreaking=Haltbarkeit -Increases item durability.=Erhöht Haldbarkeit des Gegenstands. +Increases item durability.=Erhöht Haltbarkeit des Gegenstands. Inventory=Inventar @1 Lapis Lazuli=@1 Lapislazuli @1 Enchantment Levels=@1 Verzauberungsstufen diff --git a/mods/ITEMS/mcl_farming/soil.lua b/mods/ITEMS/mcl_farming/soil.lua index 0c0e3b832..f7a7bbbfb 100644 --- a/mods/ITEMS/mcl_farming/soil.lua +++ b/mods/ITEMS/mcl_farming/soil.lua @@ -99,7 +99,7 @@ minetest.register_abm({ -- No decay near unloaded areas since these might include water. if not check_surroundings(pos, "ignore") then if wet <= 0 then - local n_def = minetest.registered_nodes[node.name] or nil + --local n_def = minetest.registered_nodes[node.name] or nil local nn = minetest.get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z}) if not nn or not nn.name then return diff --git a/mods/ITEMS/mcl_farming/wheat.lua b/mods/ITEMS/mcl_farming/wheat.lua index e3ee79ead..d986e5be3 100644 --- a/mods/ITEMS/mcl_farming/wheat.lua +++ b/mods/ITEMS/mcl_farming/wheat.lua @@ -5,7 +5,10 @@ minetest.register_craftitem("mcl_farming:wheat_seeds", { description = S("Wheat Seeds"), _tt_help = S("Grows on farmland"), _doc_items_longdesc = S("Grows into a wheat plant. Chickens like wheat seeds."), - _doc_items_usagehelp = S("Place the wheat seeds on farmland (which can be created with a hoe) to plant a wheat plant. They grow in sunlight and grow faster on hydrated farmland. Rightclick an animal to feed it wheat seeds."), + _doc_items_usagehelp = S([[ + Place the wheat seeds on farmland (which can be created with a hoe) to plant a wheat plant. + They grow in sunlight and grow faster on hydrated farmland. Rightclick an animal to feed it wheat seeds. + ]]), groups = { craftitem=1 }, inventory_image = "mcl_farming_wheat_seeds.png", on_place = function(itemstack, placer, pointed_thing) @@ -28,7 +31,10 @@ for i=1,7 do if i == 1 then create = true name = S("Premature Wheat Plant") - longdesc = S("Premature wheat plants grow on farmland under sunlight in 8 stages. On hydrated farmland, they grow faster. They can be harvested at any time but will only yield a profit when mature.") + longdesc = S([[ + Premature wheat plants grow on farmland under sunlight in 8 stages. + On hydrated farmland, they grow faster. They can be harvested at any time but will only yield a profit when mature. + ]]) else create = false end @@ -54,7 +60,8 @@ for i=1,7 do {-0.5, -0.5, -0.5, 0.5, sel_heights[i], 0.5} }, }, - groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1,attached_node=1, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1}, + groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1,attached_node=1, + dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1}, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, }) @@ -62,7 +69,10 @@ end minetest.register_node("mcl_farming:wheat", { description = S("Mature Wheat Plant"), - _doc_items_longdesc = S("Mature wheat plants are ready to be harvested for wheat and wheat seeds. They won't grow any further."), + _doc_items_longdesc = S([[ + Mature wheat plants are ready to be harvested for wheat and wheat seeds. + They won't grow any further. + ]]), sunlight_propagates = true, paramtype = "light", paramtype2 = "meshoptions", @@ -81,7 +91,8 @@ minetest.register_node("mcl_farming:wheat", { { items = {'mcl_farming:wheat_item'} } } }, - groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1,attached_node=1, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1}, + groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1, attached_node=1, + dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1}, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, }) @@ -144,9 +155,9 @@ minetest.register_node("mcl_farming:hay_block", { is_ground_content = false, stack_max = 64, paramtype2 = "facedir", - is_ground_content = false, on_place = mcl_util.rotate_axis, - groups = {handy=1, hoey=1, flammable=2, fire_encouragement=60, fire_flammability=20, building_block=1, fall_damage_add_percent=-80}, + groups = {handy=1, hoey=1, flammable=2, fire_encouragement=60, + fire_flammability=20, building_block=1, fall_damage_add_percent=-80}, sounds = mcl_sounds.node_sound_leaves_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 0.5, diff --git a/mods/ITEMS/mcl_fences/init.lua b/mods/ITEMS/mcl_fences/init.lua index 650854f88..e60782215 100644 --- a/mods/ITEMS/mcl_fences/init.lua +++ b/mods/ITEMS/mcl_fences/init.lua @@ -76,7 +76,7 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups, local meta2 local state2 = 0 - local function update_gate(pos, node) + local function update_gate(pos, node) minetest.set_node(pos, node) end diff --git a/mods/ITEMS/mcl_fences/locale/mcl_fences.de.tr b/mods/ITEMS/mcl_fences/locale/mcl_fences.de.tr index 5a76fc59e..e4f2a5fa6 100644 --- a/mods/ITEMS/mcl_fences/locale/mcl_fences.de.tr +++ b/mods/ITEMS/mcl_fences/locale/mcl_fences.de.tr @@ -1,6 +1,6 @@ # textdomain: mcl_fences Fences are structures which block the way. Fences will connect to each other and solid blocks. They cannot be jumped over with a simple jump.=Zäune sind Gebäude, die den Weg blockieren. Sie verbinden sich gegenseitig und anderen festen Blöcken. Man kann sie nicht mit normalen Sprüngen überspringen. -Fence gates can be opened or closed and can't be jumped over. Fences will connect nicely to fence gates.=Zauntore können geöffnet und geschlossen werden und können nicht übersprungen werden. Zäune werden sich gut mit Zauntoren verbinden. +Fence gates can be opened or closed and can't be jumped over. Fences will connect nicely to fence gates.=Zauntore können geöffnet und geschlossen werden und können nicht übersprungen werden. Zäune lassen sich gut mit Zauntoren verbinden. Right-click the fence gate to open or close it.=Rechtsklicken Sie auf ein Zauntor, um es zu öffnen oder zu schließen. Oak Fence=Eichenzaun Oak Fence Gate=Eichenzauntor diff --git a/mods/ITEMS/mcl_fire/fire_charge.lua b/mods/ITEMS/mcl_fire/fire_charge.lua index f4d2da321..69e536790 100644 --- a/mods/ITEMS/mcl_fire/fire_charge.lua +++ b/mods/ITEMS/mcl_fire/fire_charge.lua @@ -6,7 +6,7 @@ local add_entity = minetest.add_entity -- Fire Charge minetest.register_craftitem("mcl_fire:fire_charge", { description = S("Fire Charge"), - _tt_help = S("Dispenser projectile").."\n"..S("Starts fires and ignites blocks"), + _tt_help = S("Dispenser projectile").."\n"..S("Starts fires and ignites blocks"), _doc_items_longdesc = S("Fire charges are primarily projectiles which can be launched from dispensers, they will fly in a straight line and burst into a fire on impact. Alternatively, they can be used to ignite fires directly."), _doc_items_usagehelp = S("Put the fire charge into a dispenser and supply it with redstone power to launch it. To ignite a fire directly, simply place the fire charge on the ground, which uses it up."), inventory_image = "mcl_fire_fire_charge.png", diff --git a/mods/ITEMS/mcl_fire/flint_and_steel.lua b/mods/ITEMS/mcl_fire/flint_and_steel.lua index b0e711e0a..5aa02aec1 100644 --- a/mods/ITEMS/mcl_fire/flint_and_steel.lua +++ b/mods/ITEMS/mcl_fire/flint_and_steel.lua @@ -5,7 +5,7 @@ local add_node = minetest.add_node -- Flint and Steel minetest.register_tool("mcl_fire:flint_and_steel", { description = S("Flint and Steel"), - _tt_help = S("Starts fires and ignites blocks"), + _tt_help = S("Starts fires and ignites blocks"), _doc_items_longdesc = S("Flint and steel is a tool to start fires and ignite blocks."), _doc_items_usagehelp = S("Rightclick the surface of a block to attempt to light a fire in front of it or ignite the block. A few blocks have an unique reaction when ignited."), inventory_image = "mcl_fire_flint_and_steel.png", diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 95d76c45d..176fb250c 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -47,94 +47,16 @@ local alldirs= { x = 0, y = 0, z = 1} } --- 3 exptime variants because the animation is not tied to particle expiration time. --- 3 colorized variants to imitate minecraft's -local smoke_pdef_base = { - amount = 0.001, - time = 0, - -- minpos = vector.add(pos, { x = -0.45, y = -0.45, z = -0.45 }), - -- maxpos = vector.add(pos, { x = 0.45, y = 0.45, z = 0.45 }), +local smoke_pdef = { + amount = 0.009, + maxexptime = 4.0, minvel = { x = -0.1, y = 0.3, z = -0.1 }, maxvel = { x = 0.1, y = 1.6, z = 0.1 }, - -- minexptime = 3 exptime variants, - -- maxexptime = 3 exptime variants minsize = 4.0, maxsize = 4.5, - -- texture = "mcl_particles_smoke_anim.png^[colorize:#000000:(3 colourize variants)", - animation = { - type = "vertical_frames", - aspect_w = 8, - aspect_h = 8, - -- length = 3 exptime variants - }, - collisiondetection = true, + minrelpos = { x = -0.45, y = -0.45, z = -0.45 }, + maxrelpos = { x = 0.45, y = 0.45, z = 0.45 }, } -local smoke_pdef_cached = {} -local spawn_smoke = function(pos) - local min = math.min - local new_minpos = vector.add(pos, { x = -0.45, y = -0.45, z = -0.45 }) - local new_maxpos = vector.add(pos, { x = 0.45, y = 0.45, z = 0.45 }) - - -- populate the cache - if not next(smoke_pdef_cached) then - -- 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.75, 1.5, 4.0 } - local colorizes = { "199", "209", "243" } -- round(78%, 82%, 90% of 256) - 1 - - local id = 1 - for _,exptime in ipairs(exptimes) do - for _,colorize in ipairs(colorizes) do - smoke_pdef_base.minpos = new_minpos - smoke_pdef_base.maxpos = new_maxpos - smoke_pdef_base.maxexptime = exptime - smoke_pdef_base.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_base.minexptime = min(exptime, (7.0/8.0 * (exptime + 0.1) + 0.1)) - smoke_pdef_base.texture = "mcl_particles_smoke_anim.png^[colorize:#000000:" ..colorize - - smoke_pdef_cached[id] = table.copy(smoke_pdef_base) - - mcl_particles.add_node_particlespawner(pos, smoke_pdef_cached[id], "high") - - id = id + 1 - end - end - - -- cache already populated - else - for i, smoke_pdef in ipairs(smoke_pdef_cached) do - smoke_pdef.minpos = new_minpos - smoke_pdef.maxpos = new_maxpos - mcl_particles.add_node_particlespawner(pos, smoke_pdef, "high") - end - end - ---[[ Old smoke pdef - local spawn_smoke = function(pos) - mcl_particles.add_node_particlespawner(pos, { - amount = 0.1, - time = 0, - minpos = vector.add(pos, { x = -0.45, y = -0.45, z = -0.45 }), - maxpos = vector.add(pos, { x = 0.45, y = 0.45, z = 0.45 }), - minvel = { x = 0, y = 0.5, z = 0 }, - maxvel = { x = 0, y = 0.6, z = 0 }, - minexptime = 2.0, - maxexptime = 2.0, - minsize = 3.0, - maxsize = 4.0, - texture = "mcl_particles_smoke_anim.png^[colorize:#000000:127", - animation = { - type = "vertical_frames", - aspect_w = 8, - aspect_h = 8, - length = 2.1, - }, - }, "high") - -- ]] - -end -- -- Items @@ -303,7 +225,7 @@ minetest.register_node("mcl_fire:fire", { end fire_timer(pos) - spawn_smoke(pos) + mcl_particles.spawn_smoke(pos, "fire", smoke_pdef) end, on_destruct = function(pos) mcl_particles.delete_node_particlespawners(pos) @@ -367,7 +289,7 @@ minetest.register_node("mcl_fire:eternal_fire", { if has_mcl_portals then --Calling directly minetest.get_modpath consumes 4x more compute time mcl_portals.light_nether_portal(pos) end - spawn_smoke(pos) + mcl_particles.spawn_smoke(pos, "fire", smoke_pdef) end, on_destruct = function(pos) mcl_particles.delete_node_particlespawners(pos) @@ -627,7 +549,7 @@ minetest.register_lbm({ nodenames = {"group:fire"}, run_at_every_load = true, action = function(pos, node) - spawn_smoke(pos) + mcl_particles.spawn_smoke(pos, "fire", smoke_pdef) end, }) diff --git a/mods/ITEMS/mcl_fireworks/README.txt b/mods/ITEMS/mcl_fireworks/README.txt new file mode 100644 index 000000000..4cf71fc9b --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/README.txt @@ -0,0 +1,7 @@ +Firework mod for Mineclone 2 + +by NO11 and and some parts by j45 + +Sound credits: + +* mcl_firework_rocket.ogg (tnt_ignite.ogg): Own derivate work of sound by Ned Bouhalassa (CC0) created in 2005, source: diff --git a/mods/ITEMS/mcl_fireworks/crafting.lua b/mods/ITEMS/mcl_fireworks/crafting.lua new file mode 100644 index 000000000..a9e156aa6 --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/crafting.lua @@ -0,0 +1,17 @@ +minetest.register_craft({ + type = "shapeless", + output = "mcl_fireworks:rocket_1 3", + recipe = {"mcl_core:paper", "mcl_mobitems:gunpowder"}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_fireworks:rocket_2 3", + recipe = {"mcl_core:paper", "mcl_mobitems:gunpowder", "mcl_mobitems:gunpowder"}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_fireworks:rocket_3 3", + recipe = {"mcl_core:paper", "mcl_mobitems:gunpowder", "mcl_mobitems:gunpowder", "mcl_mobitems:gunpowder"}, +}) \ No newline at end of file diff --git a/mods/ITEMS/mcl_fireworks/init.lua b/mods/ITEMS/mcl_fireworks/init.lua new file mode 100644 index 000000000..cd1922580 --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/init.lua @@ -0,0 +1,4 @@ +local path = minetest.get_modpath("mcl_fireworks") + +dofile(path .. "/register.lua") +dofile(path .. "/crafting.lua") \ No newline at end of file diff --git a/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.de.tr b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.de.tr new file mode 100644 index 000000000..9f9098103 --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.de.tr @@ -0,0 +1,3 @@ +# textdomain: mcl_fireworks +Firework Rocket=Feuerwerksrakete +Flight Duration:=Flugdauer: \ No newline at end of file diff --git a/mods/ITEMS/mcl_fireworks/mod.conf b/mods/ITEMS/mcl_fireworks/mod.conf new file mode 100644 index 000000000..cf9e34e91 --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/mod.conf @@ -0,0 +1,2 @@ +name = mcl_fireworks +description = Adds fun fireworks to the game which players can use. \ No newline at end of file diff --git a/mods/ITEMS/mcl_fireworks/register.lua b/mods/ITEMS/mcl_fireworks/register.lua new file mode 100644 index 000000000..08f07c5cb --- /dev/null +++ b/mods/ITEMS/mcl_fireworks/register.lua @@ -0,0 +1,28 @@ +local S = minetest.get_translator("mcl_fireworks") + +local player_rocketing = {} + +local tt_help = S("Flight Duration:") +local description = S("Firework Rocket") + +local function register_rocket(n, duration, force) + minetest.register_craftitem("mcl_fireworks:rocket_" .. n, { + description = description, + _tt_help = tt_help .. " " .. duration, + inventory_image = "mcl_fireworks_rocket.png", + stack_max = 64, + on_use = function(itemstack, user, pointed_thing) + local elytra = mcl_playerplus.elytra[user] + if elytra.active and elytra.rocketing <= 0 then + elytra.rocketing = duration + itemstack:take_item() + minetest.sound_play("mcl_fireworks_rocket", {pos = user:get_pos()}) + end + return itemstack + end, + }) +end + +register_rocket(1, 2.2, 10) +register_rocket(2, 4.5, 20) +register_rocket(3, 6, 30) diff --git a/mods/ITEMS/mcl_fireworks/sounds/mcl_fireworks_rocket.ogg b/mods/ITEMS/mcl_fireworks/sounds/mcl_fireworks_rocket.ogg new file mode 100644 index 000000000..aa232f0de Binary files /dev/null and b/mods/ITEMS/mcl_fireworks/sounds/mcl_fireworks_rocket.ogg differ diff --git a/mods/ITEMS/mcl_fireworks/textures/mcl_fireworks_rocket.png b/mods/ITEMS/mcl_fireworks/textures/mcl_fireworks_rocket.png new file mode 100644 index 000000000..682a8c40d Binary files /dev/null and b/mods/ITEMS/mcl_fireworks/textures/mcl_fireworks_rocket.png differ diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 2bd0ed515..76526ee72 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -1,11 +1,6 @@ --Fishing Rod, Bobber, and Flying Bobber mechanics and Bobber artwork by Rootyjr. local S = minetest.get_translator("mcl_fishing") -local mod_throwing = minetest.get_modpath("mcl_throwing") - -local entity_mapping = { - ["mcl_fishing:bobber"] = "mcl_fishing:bobber_entity", -} local bobber_ENTITY={ physical = false, @@ -42,8 +37,7 @@ local fish = function(itemstack, player, pointed_thing) local num = 0 local ent = nil local noent = true - - + local durability = 65 local unbreaking = mcl_enchanting.get_enchantment(itemstack, "unbreaking") if unbreaking > 0 then @@ -61,7 +55,6 @@ local fish = function(itemstack, player, pointed_thing) local itemname local items local itemcount = 1 - local itemwear = 0 local pr = PseudoRandom(os.time() * math.random(1, 100)) local r = pr:next(1, 100) local fish_values = {85, 84.8, 84.7, 84.5} @@ -173,7 +166,7 @@ local fish = function(itemstack, player, pointed_thing) if noent == true then local playerpos = player:get_pos() local dir = player:get_look_dir() - local obj = mcl_throwing.throw("mcl_fishing:flying_bobber", {x=playerpos.x, y=playerpos.y+1.5, z=playerpos.z}, dir, 15, player:get_player_name()) + mcl_throwing.throw("mcl_fishing:flying_bobber", {x=playerpos.x, y=playerpos.y+1.5, z=playerpos.z}, dir, 15, player:get_player_name()) end end @@ -344,10 +337,8 @@ mcl_throwing.register_throwable_object("mcl_fishing:flying_bobber", "mcl_fishing -- If player leaves area, remove bobber. minetest.register_on_leaveplayer(function(player) local objs = minetest.get_objects_inside_radius(player:get_pos(), 250) - local num = 0 local ent = nil local noent = true - for n = 1, #objs do ent = objs[n]:get_luaentity() if ent then diff --git a/mods/ITEMS/mcl_fishing/locale/mcl_fishing.de.tr b/mods/ITEMS/mcl_fishing/locale/mcl_fishing.de.tr index 10f908593..b80c186c1 100644 --- a/mods/ITEMS/mcl_fishing/locale/mcl_fishing.de.tr +++ b/mods/ITEMS/mcl_fishing/locale/mcl_fishing.de.tr @@ -7,12 +7,12 @@ Raw fish is obtained by fishing and is a food item which can be eaten safely. Co Cooked Fish=Gekochter Fisch Mmh, fish! This is a healthy food item.=Mhh, Fisch! Ein gesundes Lebensmittel. Raw Salmon=Roher Lachs -Raw salmon is obtained by fishing and is a food item which can be eaten safely. Cooking it improves its nutritional value.=Lohen Lachs erhält man beim Angeln. Er ist ein Lebensmittel, der sicher verzehrt werden kann. +Raw salmon is obtained by fishing and is a food item which can be eaten safely. Cooking it improves its nutritional value.=Rohen Lachs erhält man beim Angeln. Er ist ein Lebensmittel, das sicher verzehrt werden kann. Cooked Salmon=Gekochter Lachs This is a healthy food item which can be eaten.=Ein gesundes essbares Lebensmittel. Clownfish=Clownfisch -Clownfish may be obtained by fishing (and luck) and is a food item which can be eaten safely.=Einen Clownfisch kann man beim Angeln mit etwas Glück fangen. Er ist ein Lebensmittel, der sicher verzehrt werden kann. +Clownfish may be obtained by fishing (and luck) and is a food item which can be eaten safely.=Einen Clownfisch kann man beim Angeln mit etwas Glück fangen. Er ist ein Lebensmittel, das sicher verzehrt werden kann. Pufferfish=Kugelfisch -Pufferfish are a common species of fish and can be obtained by fishing. They can technically be eaten, but they are very bad for humans. Eating a pufferfish only restores 1 hunger point and will poison you very badly (which drains your health non-fatally) and causes serious food poisoning (which increases your hunger).=Kugelfische sind eine verbreitete Fischart, die geangelt werden können. Sie können theoretisch gegessen werden, aber sie sind sehr schlecht für Menschen. Es gibt nur 1 Hungerpunkt und es wird Sie schwer vergiften (was Ihre Gesundheit verringert, aber nicht bis zum Tod) und Ihr Hungerpegel wird aufgrund der schweren Lebensmittelvergiftung stark ansteigen. +Pufferfish are a common species of fish and can be obtained by fishing. They can technically be eaten, but they are very bad for humans. Eating a pufferfish only restores 1 hunger point and will poison you very badly (which drains your health non-fatally) and causes serious food poisoning (which increases your hunger).=Kugelfische sind eine verbreitete Fischart, die geangelt werden kann. Sie können theoretisch gegessen werden, aber sie sind sehr schlecht für Menschen. Es gibt nur 1 Hungerpunkt und es wird Sie schwer vergiften (was Ihre Gesundheit verringert, aber nicht bis zum Tod) und Ihr Hungerpegel wird aufgrund der schweren Lebensmittelvergiftung stark ansteigen. Catches fish in water=Fängt Fische im Wasser Very poisonous=Sehr giftig diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index a155ebd0b..7a2501f25 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -180,7 +180,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im if not inv_img then inv_img = top_img end - local usagehelp, noncreative, create_entry, paramtype2, palette + local noncreative, create_entry, paramtype2, palette if is_flower == nil then is_flower = true end @@ -475,9 +475,6 @@ local fix_doubleplants = minetest.settings:get_bool("fix_doubleplants", true) if mod_mcimport and mg_name == "singlenode" and fix_doubleplants == true then local flowernames = { "peony", "rose_bush", "lilac", "sunflower", "double_fern", "double_grass" } - for c=1, 6 do - local flowername = flowernames[c] - end minetest.register_lbm({ label = "Add double plant tops.", diff --git a/mods/ITEMS/mcl_flowers/locale/mcl_flowers.de.tr b/mods/ITEMS/mcl_flowers/locale/mcl_flowers.de.tr index 7c4a83b88..0e1262e3c 100644 --- a/mods/ITEMS/mcl_flowers/locale/mcl_flowers.de.tr +++ b/mods/ITEMS/mcl_flowers/locale/mcl_flowers.de.tr @@ -12,9 +12,9 @@ Allium=Sternlauch Azure Bluet=Porzellansternchen Blue Orchid=Blaue Orchidee Tall Grass=Hohes Gras -Tall grass is a small plant which often occurs on the surface of grasslands. It can be harvested for wheat seeds. By using bone meal, tall grass can be turned into double tallgrass which is two blocks high.=Hohes Gras ist eine kleine Pflanze, die oft auf Wiesenflächen wächst. Es kann für Weizensamen abgeerntet werden. Mit Knochenmehl wird sich hohes Gras zu doppelhohem Gras verwandeln. +Tall grass is a small plant which often occurs on the surface of grasslands. It can be harvested for wheat seeds. By using bone meal, tall grass can be turned into double tallgrass which is two blocks high.=Hohes Gras ist eine kleine Pflanze, die oft auf Wiesenflächen wächst. Es kann für Weizensamen abgeerntet werden. Mit Knochenmehl lässt sich hohes Gras zu doppelhohem Gras verwandeln. Fern=Farn -Ferns are small plants which occur naturally in jungles and taigas. They can be harvested for wheat seeds. By using bone meal, a fern can be turned into a large fern which is two blocks high.=Farne sind kleine Pflanzen, die oft in Dschungeln und Taigas vorkommen. Sie können für Weizensamen abgeerntet werden. Mit Knochenmehl wird sich ein Farn zu einem großen Farn, der zwei Blöcke hoch ist, verwandeln. +Ferns are small plants which occur naturally in jungles and taigas. They can be harvested for wheat seeds. By using bone meal, a fern can be turned into a large fern which is two blocks high.=Farne sind kleine Pflanzen, die oft in Dschungeln und Taigas vorkommen. Sie können für Weizensamen abgeerntet werden. Mit Knochenmehl lässt sich ein Farn zu einem großen Farn, der zwei Blöcke hoch ist, verwandeln. (Top Part)=(Oberseite) Peony=Pfingstrose A peony is a large plant which occupies two blocks. It is mainly used in dye production.=Eine Pfingstrose ist eine große Pflanze, die zwei Blöcke hoch ist. Sie wird hauptsächlich für die Farbenproduktion gebraucht. diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 1d1ecc031..af2a60952 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -9,12 +9,12 @@ local LIGHT_ACTIVE_FURNACE = 13 local function active_formspec(fuel_percent, item_percent) return "size[9,8.75]".. - "label[0,4;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[2.75,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Furnace"))).."]".. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. "list[current_name;src;2.75,0.5;1,1;]".. mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. "list[current_name;fuel;2.75,2.5;1,1;]".. @@ -38,12 +38,12 @@ local function active_formspec(fuel_percent, item_percent) end local inactive_formspec = "size[9,8.75]".. - "label[0,4;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,4;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "label[2.75,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Furnace"))).."]".. + "label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]".. "list[current_name;src;2.75,0.5;1,1;]".. mcl_formspec.get_itemslot_bg(2.75,0.5,1,1).. "list[current_name;fuel;2.75,2.5;1,1;]".. @@ -384,7 +384,6 @@ local function furnace_node_timer(pos, elapsed) -- Update formspec and node -- local formspec = inactive_formspec - local item_state local item_percent = 0 if cookable then item_percent = math.floor(src_time / cooked.time * 100) @@ -414,7 +413,7 @@ local function furnace_node_timer(pos, elapsed) meta:set_float("fuel_time", fuel_time) meta:set_float("src_time", src_time) if srclist then - meta:set_string("src_item", srclist[1]:get_name()) + meta:set_string("src_item", src_item) else meta:set_string("src_item", "") end @@ -441,7 +440,12 @@ minetest.register_node("mcl_furnaces:furnace", { _tt_help = S("Uses fuel to smelt or cook items"), _doc_items_longdesc = S("Furnaces cook or smelt several items, using a furnace fuel, into something else."), _doc_items_usagehelp = - S("Use the furnace to open the furnace menu. Place a furnace fuel in the lower slot and the source material in the upper slot. The furnace will slowly use its fuel to smelt the item. The result will be placed into the output slot at the right side.").."\n".. + S([[ + Use the furnace to open the furnace menu. + Place a furnace fuel in the lower slot and the source material in the upper slot. + The furnace will slowly use its fuel to smelt the item. + The result will be placed into the output slot at the right side. + ]]).."\n".. S("Use the recipe book to see what you can smelt, what you can use as fuel and how long it will burn."), _doc_items_hidden = false, tiles = { diff --git a/mods/ITEMS/mcl_furnaces/mod.conf b/mods/ITEMS/mcl_furnaces/mod.conf index 99a1ad0bf..fe0b9c208 100644 --- a/mods/ITEMS/mcl_furnaces/mod.conf +++ b/mods/ITEMS/mcl_furnaces/mod.conf @@ -1,3 +1,3 @@ name = mcl_furnaces -depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_craftguide, mcl_achievements, mcl_particles, mcl_colors +depends = mcl_init, mcl_formspec, mcl_core, mcl_sounds, mcl_craftguide, mcl_achievements, mcl_particles optional_depends = doc, screwdriver diff --git a/mods/ITEMS/mcl_heads/init.lua b/mods/ITEMS/mcl_heads/init.lua index 2000c7070..e7340242d 100644 --- a/mods/ITEMS/mcl_heads/init.lua +++ b/mods/ITEMS/mcl_heads/init.lua @@ -90,7 +90,7 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor) local wdir = minetest.dir_to_wallmounted(diff) local itemstring = itemstack:get_name() - local fakestack = ItemStack(itemstack) + --local fakestack = ItemStack(itemstack) local idef = fakestack:get_definition() local retval if wdir == 0 or wdir == 1 then @@ -101,9 +101,7 @@ local function addhead(name, texture, desc, longdesc, rangemob, rangefactor) if not retval then return itemstack end - - local success - itemstack, success = minetest.item_place(fakestack, placer, pointed_thing, wdir) + itemstack,_ = minetest.item_place(fakestack, placer, pointed_thing, wdir) itemstack:set_name(itemstring) return itemstack end, diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index e9b3f75e0..eaff8f83d 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -4,10 +4,10 @@ local S = minetest.get_translator("mcl_hoppers") local mcl_hoppers_formspec = "size[9,7]".. - "label[2,0;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Hopper"))).."]".. + "label[2,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Hopper"))).."]".. "list[current_name;main;2,0.5;5,1;]".. mcl_formspec.get_itemslot_bg(2,0.5,5,1).. - "label[0,2;"..minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Inventory"))).."]".. + "label[0,2;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,2.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,2.5,9,3).. "list[current_player;main;0,5.74;9,1;]".. @@ -152,7 +152,7 @@ def_hopper_enabled.on_place = function(itemstack, placer, pointed_thing) local z = upos.z - apos.z local fake_itemstack = ItemStack(itemstack) - local newnode, param2 + local param2 if x == -1 then fake_itemstack:set_name("mcl_hoppers:hopper_side") param2 = 0 @@ -166,7 +166,7 @@ def_hopper_enabled.on_place = function(itemstack, placer, pointed_thing) fake_itemstack:set_name("mcl_hoppers:hopper_side") param2 = 1 end - local itemstack, success = minetest.item_place_node(fake_itemstack, placer, pointed_thing, param2) + local itemstack,_ = minetest.item_place_node(fake_itemstack, placer, pointed_thing, param2) itemstack:set_name("mcl_hoppers:hopper") return itemstack end @@ -411,7 +411,6 @@ minetest.register_abm({ -- Move an item from the hopper into container below local downnode = minetest.get_node(downpos) if not minetest.registered_nodes[downnode.name] then return end - g = minetest.registered_nodes[downnode.name].groups.container mcl_util.move_item_container(pos, downpos) end, }) @@ -462,7 +461,7 @@ minetest.register_abm({ -- Put fuel into fuel slot local sinv = minetest.get_inventory({type="node", pos = pos}) local dinv = minetest.get_inventory({type="node", pos = front}) - local slot_id, stack = mcl_util.get_eligible_transfer_item_slot(sinv, "main", dinv, "fuel", is_transferrable_fuel) + local slot_id,_ = mcl_util.get_eligible_transfer_item_slot(sinv, "main", dinv, "fuel", is_transferrable_fuel) if slot_id then mcl_util.move_item_container(pos, front, nil, slot_id, "fuel") end diff --git a/mods/ITEMS/mcl_hoppers/mod.conf b/mods/ITEMS/mcl_hoppers/mod.conf index 53f514f39..c89292f6b 100644 --- a/mods/ITEMS/mcl_hoppers/mod.conf +++ b/mods/ITEMS/mcl_hoppers/mod.conf @@ -1,4 +1,4 @@ name = mcl_hoppers description = It's just a clone of Minecraft hoppers, functions nearly identical to them minus mesecons making them stop and the way they're placed. -depends = mcl_core, mcl_formspec, mcl_sounds, mcl_util, mcl_colors +depends = mcl_core, mcl_formspec, mcl_sounds, mcl_util optional_depends = doc, screwdriver diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr index d47b811f0..2fd938f2f 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr @@ -61,7 +61,7 @@ This item is mainly used for crafting.=Dieser Gegenstand wird hauptsächlich in Magma Cream=Magmacreme Magma cream is a crafting component.=Magmacreme ist eine Fertigungskomponente. Ghast Tear=Ghast-Träne -Place this item in an item frame as decoration.=Platzieren Sie diesen Gegenstand in einem Rahmel als Deko. +Place this item in an item frame as decoration.=Platzieren Sie diesen Gegenstand in einem Rahmen als Deko. Nether Star=Nether-Stern A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration.=Ein Netherstern wird abgeworfen, wenn der Wither stirbt. Platzieren Sie ihn in einen Rahmen, um der Welt zu zeigen, wie großartig Sie sind! diff --git a/mods/ITEMS/mcl_monster_eggs/init.lua b/mods/ITEMS/mcl_monster_eggs/init.lua index 55875159e..dd986d127 100644 --- a/mods/ITEMS/mcl_monster_eggs/init.lua +++ b/mods/ITEMS/mcl_monster_eggs/init.lua @@ -20,11 +20,13 @@ local register_block = function(subname, description, tiles, is_ground_content) is_ground_content = is_ground_content, groups = {dig_immediate = 3, spawns_silverfish = 1, deco_block = 1}, drop = '', - is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), after_dig_node = spawn_silverfish, _tt_help = S("Hides a silverfish"), - _doc_items_longdesc = S("An infested block is a block from which a silverfish will pop out when it is broken. It looks identical to its normal counterpart."), + _doc_items_longdesc = S([[ + An infested block is a block from which a silverfish will pop out when it is broken. + It looks identical to its normal counterpart. + ]]), _mcl_hardness = 0, _mcl_blast_resistance = 0.5, }) diff --git a/mods/ITEMS/mcl_mushroom/init.lua b/mods/ITEMS/mcl_mushroom/init.lua index b970cf85d..7bb703f1a 100644 --- a/mods/ITEMS/mcl_mushroom/init.lua +++ b/mods/ITEMS/mcl_mushroom/init.lua @@ -53,7 +53,8 @@ minetest.register_node("mcl_mushroom:shroomlight", { groups = {handy=1,hoe=7,swordy=1, leafdecay=leafdecay_distance, leaves=1, deco_block=1, }, stack_max = 64, _mcl_hardness = 2, - light_source = 15 + -- this is 15 in Minecraft + light_source = 14, }) minetest.register_node("mcl_mushroom:warped_hyphae", { diff --git a/mods/ITEMS/mcl_mushrooms/small.lua b/mods/ITEMS/mcl_mushrooms/small.lua index 8105386f4..52c64928f 100644 --- a/mods/ITEMS/mcl_mushrooms/small.lua +++ b/mods/ITEMS/mcl_mushrooms/small.lua @@ -4,7 +4,6 @@ local on_place = mcl_util.generate_on_place_plant_function(function(place_pos, p local soil_node = minetest.get_node_or_nil({x=place_pos.x, y=place_pos.y-1, z=place_pos.z}) if not soil_node then return false end local snn = soil_node.name -- soil node name - local sd = minetest.registered_nodes[snn] -- soil definition -- Placement rules: -- * Always allowed on podzol or mycelimu diff --git a/mods/ITEMS/mcl_ocean/corals.lua b/mods/ITEMS/mcl_ocean/corals.lua index f3de5968e..376b8a22f 100644 --- a/mods/ITEMS/mcl_ocean/corals.lua +++ b/mods/ITEMS/mcl_ocean/corals.lua @@ -265,7 +265,6 @@ minetest.register_abm({ if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "mcl_core:water_source" then -- Find dead form (it's the same as the node's drop) local def = minetest.registered_nodes[node.name] - local dead if def then node.name = def.drop else diff --git a/mods/ITEMS/mcl_ocean/kelp.lua b/mods/ITEMS/mcl_ocean/kelp.lua index 9670943da..326b08a81 100644 --- a/mods/ITEMS/mcl_ocean/kelp.lua +++ b/mods/ITEMS/mcl_ocean/kelp.lua @@ -37,14 +37,9 @@ local mt_record_protection_violation = minetest.record_protection_violation local mt_is_creative_enabled = minetest.is_creative_enabled local mt_sound_play = minetest.sound_play -local math_min = math.min -local math_max = math.max -local math_ceil = math.ceil -local math_floor = math.floor -local math_random = math.random -local string_format = string.format -local table_copy = table.copy -local table_insert = table.insert +local math = math +local string = string +local table = table -- DEBUG: functions -- local log = minetest.log @@ -122,7 +117,7 @@ function kelp.is_downward_flowing(pos, node, pos_above, node_above, __is_above__ -- Function params: (pos[, node]) or (node, pos_above) or (node, node_above) local node = node or mt_get_node(pos) - local result = (math_floor(node.param2 / 8) % 2) == 1 + local result = (math.floor(node.param2 / 8) % 2) == 1 if not (result or __is_above__) then -- If not, also check node above. -- (this is needed due a weird quirk in the definition of "downwards flowing" @@ -182,14 +177,14 @@ end -- Roll whether to grow kelp or not. function kelp.roll_growth(numerator, denominator) -- Optional params: numerator, denominator - return math_random(denominator or kelp.ROLL_GROWTH_DENOMINATOR) <= (numerator or kelp.ROLL_GROWTH_NUMERATOR) + return math.random(denominator or kelp.ROLL_GROWTH_DENOMINATOR) <= (numerator or kelp.ROLL_GROWTH_NUMERATOR) end -- Roll initial age for kelp. function kelp.roll_init_age(min, max) -- Optional params - return math_random(min or kelp.MIN_AGE, (max or kelp.MAX_AGE)-1) + return math.random(min or kelp.MIN_AGE, (max or kelp.MAX_AGE)-1) end @@ -197,7 +192,7 @@ end -- For the special case where the max param2 is reached, interpret that as the -- 16th kelp stem. function kelp.get_height(param2) - return math_floor(param2 / 16) + math_floor(param2 % 16 / 8) + return math.floor(param2 / 16) + math.floor(param2 % 16 / 8) end @@ -232,7 +227,7 @@ end -- Obtain next param2. function kelp.next_param2(param2) -- param2 max value is 255, so adding to 256 causes overflow. - return math_min(param2+16 - param2 % 16, 255); + return math.min(param2+16 - param2 % 16, 255); end @@ -242,8 +237,8 @@ function kelp.store_meta() for _ in pairs(kelp.age_queue_pos) do count = count + 1 end - -- chatlog(string_format("Storing age metadata: %d in queue", #kelp.age_queue)) - -- chatlog(string_format("Storing age metadata: %d valid in queue", count)) + -- chatlog(string.format("Storing age metadata: %d in queue", #kelp.age_queue)) + -- chatlog(string.format("Storing age metadata: %d valid in queue", count)) for i=1,#kelp.age_queue do local pos_hash = kelp.age_queue[i] local pos = kelp.age_queue_pos[pos_hash] @@ -265,7 +260,7 @@ function kelp.store_age(age, pos, pos_hash) kelp.age_pool[pos_hash] = age if not kelp.age_queue_pos[pos_hash] then - table_insert(kelp.age_queue, pos_hash) + table.insert(kelp.age_queue, pos_hash) kelp.age_queue_pos[pos_hash] = pos return true, pos_hash end @@ -713,7 +708,7 @@ function kelp.register_kelp_surface(surface, surface_deftemplate, surface_docs) doc.add_entry_alias("nodes", surface_docs.entry_id_orig, "nodes", surfacename) end - local sounds = table_copy(def.sounds) + local sounds = table.copy(def.sounds) sounds.dig = kelp.leaf_sounds.dig sounds.dug = kelp.leaf_sounds.dug sounds.place = kelp.leaf_sounds.place @@ -732,9 +727,9 @@ end -- Kelp surfaces nodes --------------------------------------------------------- -- Dirt must be registered first, for the docs -kelp.register_kelp_surface(kelp.surfaces[1], table_copy(kelp.surface_deftemplate), kelp.surface_docs) +kelp.register_kelp_surface(kelp.surfaces[1], table.copy(kelp.surface_deftemplate), kelp.surface_docs) for i=2, #kelp.surfaces do - kelp.register_kelp_surface(kelp.surfaces[i], table_copy(kelp.surface_deftemplate), kelp.surface_docs) + kelp.register_kelp_surface(kelp.surfaces[i], table.copy(kelp.surface_deftemplate), kelp.surface_docs) end -- Kelp item ------------------------------------------------------------------- diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 1d9fe2efb..a121f719c 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -27,9 +27,8 @@ local DELAY = 3 -- seconds before teleporting in Nether portal in Survival mo local DISTANCE_MAX = 128 local PORTAL = "mcl_portals:portal" local OBSIDIAN = "mcl_core:obsidian" -local O_Y_MIN, O_Y_MAX = max(mcl_vars.mg_overworld_min, -31), min(mcl_vars.mg_overworld_max_official, 2048) -local N_Y_MIN, N_Y_MAX = mcl_vars.mg_bedrock_nether_bottom_min, mcl_vars.mg_bedrock_nether_top_max - H_MIN -local O_DY, N_DY = O_Y_MAX - O_Y_MIN + 1, N_Y_MAX - N_Y_MIN + 1 +local O_Y_MIN, O_Y_MAX = max(mcl_vars.mg_overworld_min, -31), min(mcl_vars.mg_overworld_max, 2048) +local N_Y_MIN, N_Y_MAX = mcl_vars.mg_bedrock_nether_bottom_min, mcl_vars.mg_bedrock_nether_top_min - H_MIN -- Alpha and particles local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none" @@ -78,6 +77,8 @@ local pos_to_string = minetest.pos_to_string local is_area_protected = minetest.is_area_protected local get_us_time = minetest.get_us_time +local dimension_to_teleport = { nether = "overworld", overworld = "nether" } + local limits = { nether = { pmin = {x=LIM_MIN, y = N_Y_MIN, z = LIM_MIN}, @@ -181,10 +182,10 @@ local function get_target(p) x, o1 = ping_pong(x, TRAVEL_X, LIM_MIN, LIM_MAX) z, o2 = ping_pong(z, TRAVEL_Z, LIM_MIN, LIM_MAX) y = floor(y * TRAVEL_Y + (o1+o2) / 16 * LIM_MAX) - y = min(max(y + mcl_vars.mg_overworld_min, mcl_vars.mg_overworld_min), mcl_vars.mg_overworld_max) + y = min(max(y + O_Y_MIN, O_Y_MIN), O_Y_MAX) elseif d=="overworld" then x, y, z = floor(x / TRAVEL_X + 0.5), floor(y / TRAVEL_Y + 0.5), floor(z / TRAVEL_Z + 0.5) - y = min(max(y + mcl_vars.mg_nether_min, mcl_vars.mg_nether_min), mcl_vars.mg_nether_max) + y = min(max(y + N_Y_MIN, N_Y_MIN), N_Y_MAX) end return {x=x, y=y, z=z}, d end @@ -457,8 +458,8 @@ local function ecb_scan_area_2(blockpos, action, calls_remaining, param) local nodes = find_nodes_in_area_under_air(pos1, pos2, {"group:building_block"}) if nodes then local nc = #nodes + log("action", "[mcl_portals] Area for destination Nether portal emerged! Found " .. tostring(nc) .. " nodes under the air around "..pos_to_string(pos)) if nc > 0 then - log("action", "[mcl_portals] Area for destination Nether portal emerged! Found " .. tostring(nc) .. " nodes under the air around "..pos_to_string(pos)) for i=1,nc do local node = nodes[i] local node1 = {x=node.x, y=node.y+1, z=node.z } @@ -474,7 +475,7 @@ local function ecb_scan_area_2(blockpos, action, calls_remaining, param) return end if not distance or (distance0 < distance) or (distance0 < distance-1 and node.y > lava and pos0.y < lava) then - log("action", "[mcl_portals] found distance "..tostring(distance0).." at pos "..pos_to_string(node)) + log("verbose", "[mcl_portals] found distance "..tostring(distance0).." at pos "..pos_to_string(node)) distance = distance0 pos0 = {x=node1.x, y=node1.y, z=node1.z} end @@ -626,7 +627,7 @@ end -- Pos can be any of the inner part. -- The frame MUST be filled only with air or any fire, which will be replaced with Nether portal blocks. -- If no Nether portal can be lit, nothing happens. --- Returns number of portals created (0, 1 or 2) +-- Returns true if portal created function mcl_portals.light_nether_portal(pos) -- Only allow to make portals in Overworld and Nether local dim = mcl_worlds.pos_to_dimension(pos) @@ -636,11 +637,6 @@ function mcl_portals.light_nether_portal(pos) local orientation = random(0, 1) for orientation_iteration = 1, 2 do if check_and_light_shape(pos, orientation) then - minetest.after(0.2, function(pos) -- generate target map chunk - local pos1 = add(mul(mcl_vars.pos_to_chunk(pos), mcl_vars.chunk_size_in_nodes), mcl_vars.central_chunk_offset_in_nodes) - local pos2 = add(pos1, mcl_vars.chunk_size_in_nodes - 1) - minetest.emerge_area(pos1, pos2) - end, vector.new(pos)) return true end orientation = 1 - orientation @@ -672,6 +668,7 @@ local function teleport_no_delay(obj, pos) if exit then finalize_teleport(obj, exit) else + dim = dimension_to_teleport[dim] -- need to create arrival portal create_portal(target, limits[dim].pmin, limits[dim].pmax, name, obj) end diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 996637aa7..211cf50b0 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -701,6 +701,10 @@ function mcl_potions.healing_func(player, hp) local obj = player:get_luaentity() + if player:get_hp() == 0 then + return + end + if obj and obj.harmed_by_heal then hp = -hp end if hp > 0 then diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 65bb0d4de..6cfa0dc50 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -25,11 +25,9 @@ dofile(modpath .. "/lingering.lua") dofile(modpath .. "/tipped_arrow.lua") dofile(modpath .. "/potions.lua") -local brewhelp = S("Try different combinations to create potions.") - minetest.register_craftitem("mcl_potions:fermented_spider_eye", { description = S("Fermented Spider Eye"), - _doc_items_longdesc = brewhelp, + _doc_items_longdesc = S("Try different combinations to create potions."), wield_image = "mcl_potions_spider_eye_fermented.png", inventory_image = "mcl_potions_spider_eye_fermented.png", groups = { brewitem = 1, }, @@ -65,14 +63,12 @@ minetest.register_craftitem("mcl_potions:glass_bottle", { -- Try to fill glass bottle with water local get_water = false - local from_liquid_source = false + --local from_liquid_source = false local river_water = false - if not def then - -- Unknown node: no-op - elseif def.groups and def.groups.water and def.liquidtype == "source" then + if def and def.groups and def.groups.water and def.liquidtype == "source" then -- Water source get_water = true - from_liquid_source = true + --from_liquid_source = true river_water = node.name == "mclx_core:river_water_source" -- Or reduce water level of cauldron by 1 elseif string.sub(node.name, 1, 14) == "mcl_cauldrons:" then @@ -440,7 +436,6 @@ function mcl_potions.get_alchemy(ingr, pot) if brew_table[ingr] ~= nil then return brew_table[ingr] end - end if mod_table[ingr] ~= nil then diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 4a82348e5..2d76a217b 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -1,5 +1,5 @@ local S = minetest.get_translator("mcl_potions") -local brewhelp = S("Try different combinations to create potions.") +--local brewhelp = S("Try different combinations to create potions.") local potion_image = function(colorstring, opacity) if not opacity then @@ -98,7 +98,7 @@ local function register_potion(def) end elseif def.name == "healing" or def.name == "harming" then _tt = S("@1 HP", effect) - else + else _tt = tt or time_string(dur) or S("No effect") end return _tt diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index bea07b8cf..f986134d6 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -123,6 +123,6 @@ function mcl_potions.register_splash(name, descr, color, def) }) end -local function time_string(dur) +--[[local function time_string(dur) return math.floor(dur/60)..string.format(":%02d",math.floor(dur % 60)) -end +end]] diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 860019e8a..abeae8106 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -4,12 +4,12 @@ local ARROW_TIMEOUT = 60 -- Time after which stuck arrow is rechecked for being stuck local STUCK_RECHECK_TIME = 5 -local GRAVITY = 9.81 +--local GRAVITY = 9.81 local YAW_OFFSET = -math.pi/2 local dir_to_pitch = function(dir) - local dir2 = vector.normalize(dir) + --local dir2 = vector.normalize(dir) local xz = math.abs(dir.x) + math.abs(dir.z) return -math.atan2(-dir.y, xz) end @@ -197,7 +197,6 @@ function mcl_potions.register_arrow(name, desc, color, def) glow = 1, }) end - -- We just check for any hurtable objects nearby. -- The radius of 3 is fairly liberal, but anything lower than than will cause -- arrow to hilariously go through mobs often. @@ -360,7 +359,7 @@ function mcl_potions.register_arrow(name, desc, color, def) if not v then v = 0 end - local old_v = self._viscosity + --local old_v = self._viscosity self._viscosity = v local vpenalty = math.max(0.1, 0.98 - 0.1 * v) if math.abs(vel.x) > 0.001 then diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index e053c6e82..be9db2fee 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -93,7 +93,7 @@ local generate_line = function(s, ypos) local chars = 0 local printed_char_width = CHAR_WIDTH + 1 while chars < LINE_LENGTH and i <= #s do - local file = nil + local file -- Get and render character if charmap[s:sub(i, i)] ~= nil then file = charmap[s:sub(i, i)] @@ -185,7 +185,7 @@ local function get_wall_signtext_info(param2, nodename) end end -local sign_groups = {handy=1,axey=1, flammable=1, deco_block=1, material_wood=1, attached_node=1, dig_by_piston=1, flammable=-1} +local sign_groups = {handy=1,axey=1, deco_block=1, material_wood=1, attached_node=1, dig_by_piston=1, flammable=-1} local destruct_sign = function(pos) local objects = minetest.get_objects_inside_radius(pos, 0.5) @@ -322,7 +322,7 @@ minetest.register_node("mcl_signs:wall_sign", { local wdir = minetest.dir_to_wallmounted(dir) - local placer_pos = placer:get_pos() + --local placer_pos = placer:get_pos() local fdir = minetest.dir_to_facedir(dir) diff --git a/mods/ITEMS/mcl_stairs/api.lua b/mods/ITEMS/mcl_stairs/api.lua index aecf10836..cca54226f 100644 --- a/mods/ITEMS/mcl_stairs/api.lua +++ b/mods/ITEMS/mcl_stairs/api.lua @@ -20,7 +20,7 @@ local function place_slab_normal(itemstack, placer, pointed_thing) local p0 = pointed_thing.under local p1 = pointed_thing.above - local placer_pos = placer:get_pos() + --local placer_pos = placer:get_pos() local fpos = get_fpos(placer, pointed_thing) @@ -179,7 +179,7 @@ end -- Slab facedir to placement 6d matching table -local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4} +--local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4} -- Register slabs. -- Node will be called mcl_stairs:slab_ @@ -268,6 +268,7 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti end end, _mcl_hardness = hardness, + _mcl_blast_resistance = blast_resistance, _mcl_other_slab_half = upper_slab, on_rotate = function(pos, node, user, mode, param2) -- Flip slab @@ -331,6 +332,7 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti sounds = sounds, drop = lower_slab .. " 2", _mcl_hardness = hardness, + _mcl_blast_resistance = blast_resistance, }) if recipeitem then diff --git a/mods/ITEMS/mcl_sweet_berry/init.lua b/mods/ITEMS/mcl_sweet_berry/init.lua new file mode 100644 index 000000000..d1967c68c --- /dev/null +++ b/mods/ITEMS/mcl_sweet_berry/init.lua @@ -0,0 +1,89 @@ +minetest.register_craftitem("mcl_sweet_berry:sweet_berry", { + description = "Sweet Berry", + inventory_image = "sweet_berry.png", + on_use = minetest.item_eat(2) +}) +minetest.register_node("mcl_sweet_berry:sweet_berry_bush_0", { + drawtype = "plantlike", + tiles = {"sweet_berry_bush_0.png"}, + damage_per_second = 1, + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, + drop = "" +}) +minetest.register_node("mcl_sweet_berry:sweet_berry_bush_1", { + drawtype = "plantlike", + tiles = {"sweet_berry_bush_1.png"}, + damage_per_second = 1, + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, + drop = "" +}) +minetest.register_node("mcl_sweet_berry:sweet_berry_bush_2", { + drawtype = "plantlike", + tiles = {"sweet_berry_bush_2.png"}, + damage_per_second = 2, + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, + drop = "mc:sweet_berry 2" +}) +minetest.register_node("mcl_sweet_berry:sweet_berry_bush_3", { + drawtype = "plantlike", + tiles = {"sweet_berry_bush_3.png"}, + damage_per_second = 2, + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, + drop = "mc:sweet_berry 3" +}) +minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_core:dirt_with_grass"}, + sidelen = 16, + fill_ratio = 0.1, + biomes = {"Taiga","Forest"}, + y_max = mcl_vars.mg_overworld_max, + y_min = mcl_vars.mg_overworld_min, + decoration = "mcl_sweet_berry:sweet_berry_bush_2" +}) +minetest.register_abm({ + nodenames = {"mcl_sweet_berry:sweet_berry_bush_0"}, + interval = 10.0, + chance = 16, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_1"}) + end +}) +minetest.register_abm({ + nodenames = {"mcl_sweet_berry:sweet_berry_bush_1"}, + interval = 10.0, + chance = 16, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_2"}) + end +}) +minetest.register_abm({ + nodenames = {"mcl_sweet_berry:sweet_berry_bush_2"}, + interval = 10.0, + chance = 16, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_3"}) + end +}) + +--taken from mc modpack by TechDude/TechDudie + + + + + + + + diff --git a/mods/ITEMS/mcl_sweet_berry/mod.conf b/mods/ITEMS/mcl_sweet_berry/mod.conf new file mode 100644 index 000000000..0642018e9 --- /dev/null +++ b/mods/ITEMS/mcl_sweet_berry/mod.conf @@ -0,0 +1,2 @@ +name=mcl_sweet_berry +depends=mcl_vars \ No newline at end of file diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry.png b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry.png new file mode 100644 index 000000000..907293284 Binary files /dev/null and b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry.png differ diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_0.png b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_0.png new file mode 100644 index 000000000..bbf2879dd Binary files /dev/null and b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_0.png differ diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_1.png b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_1.png new file mode 100644 index 000000000..661672caa Binary files /dev/null and b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_1.png differ diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_2.png b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_2.png new file mode 100644 index 000000000..61ac69bfe Binary files /dev/null and b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_2.png differ diff --git a/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_3.png b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_3.png new file mode 100644 index 000000000..f1a0aff1a Binary files /dev/null and b/mods/ITEMS/mcl_sweet_berry/textures/sweet_berry_bush_3.png differ diff --git a/mods/ITEMS/mcl_throwing/init.lua b/mods/ITEMS/mcl_throwing/init.lua index 09a34c12f..2d57744d0 100644 --- a/mods/ITEMS/mcl_throwing/init.lua +++ b/mods/ITEMS/mcl_throwing/init.lua @@ -1,10 +1,8 @@ mcl_throwing = {} -local S = minetest.get_translator("mcl_throwing") -local mod_death_messages = minetest.get_modpath("mcl_death_messages") local modpath = minetest.get_modpath(minetest.get_current_modname()) --- +-- -- Snowballs and other throwable items -- @@ -42,7 +40,7 @@ function mcl_throwing.get_player_throw_function(entity_name, velocity) local func = function(item, player, pointed_thing) local playerpos = player:get_pos() local dir = player:get_look_dir() - local obj = mcl_throwing.throw(item, {x=playerpos.x, y=playerpos.y+1.5, z=playerpos.z}, dir, velocity, player:get_player_name()) + mcl_throwing.throw(item, {x=playerpos.x, y=playerpos.y+1.5, z=playerpos.z}, dir, velocity, player:get_player_name()) if not minetest.is_creative_enabled(player:get_player_name()) then item:take_item() end diff --git a/mods/ITEMS/mcl_throwing/register.lua b/mods/ITEMS/mcl_throwing/register.lua index 3d8cc94cf..c2af9717f 100644 --- a/mods/ITEMS/mcl_throwing/register.lua +++ b/mods/ITEMS/mcl_throwing/register.lua @@ -224,7 +224,7 @@ local pearl_on_step = function(self, dtime) lv, ld = math.abs(vc.x), "x" end if math.abs(vc.z) > lv then - lv, ld = math.abs(vc.z), "z" + ld = "z" --math.abs(vc.z) end if ld ~= "x" then vc.x = 0 end if ld ~= "y" then vc.y = 0 end diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 8001e5cf0..19bd04a18 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -1,8 +1,6 @@ local S = minetest.get_translator("mcl_tnt") local tnt_griefing = minetest.settings:get_bool("mcl_tnt_griefing", true) -local mod_death_messages = minetest.get_modpath("mcl_death_messages") - local function spawn_tnt(pos, entname) minetest.sound_play("tnt_ignite", {pos = pos,gain = 1.0,max_hear_distance = 15,}, true) local tnt = minetest.add_entity(pos, entname) diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index 2d804b9bc..809a49279 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -233,7 +233,7 @@ if minetest.get_modpath("mcl_farming") then local wear = mcl_autogroup.get_wear(toolname, "shearsy") itemstack:add_wear(wear) end - minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above}, true) + minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = pointed_thing.above}, true) local dir = vector.subtract(pointed_thing.under, pointed_thing.above) local param2 = minetest.dir_to_facedir(dir) minetest.swap_node(pointed_thing.under, {name="mcl_farming:pumpkin_face", param2 = param2}) @@ -352,54 +352,32 @@ minetest.register_tool("mcl_tools:shovel_diamond", { }) -- Axes - local make_stripped_trunk = function(itemstack, placer, pointed_thing) - if pointed_thing.type == "node" then - local pos = minetest.get_pointed_thing_position(pointed_thing) - local node = minetest.get_node(pos) - local node_name = node.name - if placer and not placer:get_player_control().sneak then - if minetest.registered_nodes[node_name] and minetest.registered_nodes[node_name].on_rightclick then - return minetest.registered_nodes[node_name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack - end - end - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then - minetest.record_protection_violation(pointed_thing.under, placer:get_player_name()) - return itemstack - end + if pointed_thing.type ~= "node" then return end + + local node = minetest.get_node(pointed_thing.under) + local noddef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name] + + if not placer:get_player_control().sneak and noddef.on_rightclick then + return minetest.item_place(itemstack, placer, pointed_thing) + end + if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + minetest.record_protection_violation(pointed_thing.under, placer:get_player_name()) + return itemstack + end + + if noddef._mcl_stripped_varient == nil then + return itemstack + else + minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_varient, param2=node.param2}) if not minetest.is_creative_enabled(placer:get_player_name()) then -- Add wear (as if digging a axey node) local toolname = itemstack:get_name() local wear = mcl_autogroup.get_wear(toolname, "axey") itemstack:add_wear(wear) end - if node_name == "mcl_core:tree" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_oak"}) - elseif node_name == "mcl_core:darktree" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_dark_oak"}) - elseif node_name == "mcl_core:acaciatree" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_acacia"}) - elseif node_name == "mcl_core:birchtree" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_birch"}) - elseif node_name == "mcl_core:sprucetree" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_spruce"}) - elseif node_name == "mcl_core:jungletree" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_jungle"}) - elseif node_name == "mcl_core:tree_bark" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_oak_bark"}) - elseif node_name == "mcl_core:darktree_bark" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_dark_oak_bark"}) - elseif node_name == "mcl_core:acaciatree_bark" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_acacia_bark"}) - elseif node_name == "mcl_core:birchtree_bark" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_birch_bark"}) - elseif node_name == "mcl_core:sprucetree_bark" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_spruce_bark"}) - elseif node_name == "mcl_core:jungletree_bark" then - minetest.swap_node(pointed_thing.under, {name="mcl_core:stripped_jungle_bark"}) - end end - return itemstack + return itemstack end minetest.register_tool("mcl_tools:axe_wood", { diff --git a/mods/ITEMS/mcl_torches/api.lua b/mods/ITEMS/mcl_torches/api.lua new file mode 100644 index 000000000..c98bda3d9 --- /dev/null +++ b/mods/ITEMS/mcl_torches/api.lua @@ -0,0 +1,267 @@ +local smoke_pdef = { + amount = 0.5, + maxexptime = 2.0, + minvel = { x = 0.0, y = 0.5, z = 0.0 }, + maxvel = { x = 0.0, y = 0.6, z = 0.0 }, + minsize = 1.5, + maxsize = 1.5, + minrelpos = { x = -1/16, y = 0.04, z = -1/16 }, + maxrelpos = { x = 1/16, y = 0.06, z = 1/16 }, +} + +local spawn_flames_floor = function(pos) + -- Flames + mcl_particles.add_node_particlespawner(pos, { + amount = 8, + time = 0, + minpos = vector.add(pos, { x = -0.1, y = 0.05, z = -0.1 }), + maxpos = vector.add(pos, { x = 0.1, y = 0.15, z = 0.1 }), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.7, + maxsize = 2, + texture = "mcl_particles_flame.png", + glow = minetest.registered_nodes[minetest.get_node(pos).name].light_source, + }, "low") + -- Smoke + mcl_particles.spawn_smoke(pos, "torch", smoke_pdef) +end + +local spawn_flames_wall = function(pos) + --local minrelpos, maxrelpos + local node = minetest.get_node(pos) + local dir = minetest.wallmounted_to_dir(node.param2) + + local smoke_pdef = table.copy(smoke_pdef) + + if dir.x < 0 then + smoke_pdef.minrelpos = { x = -0.38, y = 0.04, z = -0.1 } + smoke_pdef.maxrelpos = { x = -0.2, y = 0.14, z = 0.1 } + elseif dir.x > 0 then + smoke_pdef.minrelpos = { x = 0.2, y = 0.04, z = -0.1 } + smoke_pdef.maxrelpos = { x = 0.38, y = 0.14, z = 0.1 } + elseif dir.z < 0 then + smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = -0.38 } + smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = -0.2 } + elseif dir.z > 0 then + smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = 0.2 } + smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = 0.38 } + else + return + end + + + -- Flames + mcl_particles.add_node_particlespawner(pos, { + amount = 8, + time = 0, + minpos = vector.add(pos, smoke_pdef.minrelpos), + maxpos = vector.add(pos, smoke_pdef.maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.7, + maxsize = 2, + texture = "mcl_particles_flame.png", + glow = minetest.registered_nodes[node.name].light_source, + }, "low") + -- Smoke + mcl_particles.spawn_smoke(pos, "torch", smoke_pdef) +end + +local remove_flames = function(pos) + mcl_particles.delete_node_particlespawners(pos) +end + +-- +-- 3d torch part +-- + +-- Check if placement at given node is allowed +local function check_placement_allowed(node, wdir) + -- Torch placement rules: Disallow placement on some nodes. General rule: Solid, opaque, full cube collision box nodes are allowed. + -- Special allowed nodes: + -- * soul sand + -- * mob spawner + -- * chorus flower + -- * glass, barrier, ice + -- * Fence, wall, end portal frame with ender eye: Only on top + -- * Slab, stairs: Only on top if upside down + + -- Special forbidden nodes: + -- * Piston, sticky piston + local def = minetest.registered_nodes[node.name] + if not def then + return false + -- No ceiling torches + elseif wdir == 0 then + return false + elseif not def.buildable_to then + if node.name ~= "mcl_core:ice" and node.name ~= "mcl_nether:soul_sand" and node.name ~= "mcl_mobspawners:spawner" and node.name ~= "mcl_core:barrier" and node.name ~= "mcl_end:chorus_flower" and node.name ~= "mcl_end:chorus_flower_dead" and (not def.groups.glass) and + ((not def.groups.solid) or (not def.groups.opaque)) then + -- Only allow top placement on these nodes + if node.name == "mcl_end:dragon_egg" or node.name == "mcl_portals:end_portal_frame_eye" or def.groups.fence == 1 or def.groups.wall or def.groups.slab_top == 1 or def.groups.anvil or def.groups.pane or (def.groups.stair == 1 and minetest.facedir_to_dir(node.param2).y ~= 0) then + if wdir ~= 1 then + return false + end + else + return false + end + elseif minetest.get_item_group(node.name, "piston") >= 1 then + return false + end + end + return true +end + +function mcl_torches.register_torch(def) + local itemstring = minetest.get_current_modname() .. ":" .. def.name + local itemstring_wall = itemstring .. "_wall" + + def.light = def.light or minetest.LIGHT_MAX + def.mesh_floor = def.mesh_floor or "mcl_torches_torch_floor.obj" + def.mesh_wall = def.mesh_wall or "mcl_torches_torch_wall.obj" + + local groups = def.groups or {} + + groups.attached_node = 1 + groups.torch = 1 + groups.torch_particles = def.particles and 1 + groups.dig_by_water = 1 + groups.destroy_by_lava_flow = 1 + groups.dig_by_piston = 1 + + local floordef = { + description = def.description, + _doc_items_longdesc = def.doc_items_longdesc, + _doc_items_usagehelp = def.doc_items_usagehelp, + _doc_items_hidden = def.doc_items_hidden, + _doc_items_create_entry = def._doc_items_create_entry, + drawtype = "mesh", + mesh = def.mesh_floor, + inventory_image = def.icon, + wield_image = def.icon, + tiles = def.tiles, + use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + liquids_pointable = false, + light_source = def.light, + groups = groups, + drop = def.drop or itemstring, + selection_box = { + type = "wallmounted", + wall_top = {-1/16, -1/16, -1/16, 1/16, 0.5, 1/16}, + wall_bottom = {-1/16, -0.5, -1/16, 1/16, 1/16, 1/16}, + }, + sounds = def.sounds, + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + -- no interaction possible with entities, for now. + return itemstack + end + + local under = pointed_thing.under + local node = minetest.get_node(under) + local def = minetest.registered_nodes[node.name] + if not def then return itemstack end + + -- Call on_rightclick if the pointed node defines it + if placer and not placer:get_player_control().sneak then + if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then + return minetest.registered_nodes[node.name].on_rightclick(under, node, placer, itemstack) or itemstack + end + end + + local above = pointed_thing.above + local wdir = minetest.dir_to_wallmounted({x = under.x - above.x, y = under.y - above.y, z = under.z - above.z}) + + if check_placement_allowed(node, wdir) == false then + return itemstack + end + + local itemstring = itemstack:get_name() + local fakestack = ItemStack(itemstack) + local idef = fakestack:get_definition() + local retval + + if wdir == 1 then + retval = fakestack:set_name(itemstring) + else + retval = fakestack:set_name(itemstring_wall) + end + if not retval then + return itemstack + end + + local success + itemstack, success = minetest.item_place(fakestack, placer, pointed_thing, wdir) + itemstack:set_name(itemstring) + + if success and idef.sounds and idef.sounds.place then + minetest.sound_play(idef.sounds.place, {pos=under, gain=1}, true) + end + return itemstack + end, + on_rotate = false, + on_construct = def.particles and spawn_flames_floor, + on_destruct = def.particles and remove_flames, + } + minetest.register_node(itemstring, floordef) + + local groups_wall = table.copy(groups) + groups_wall.torch = 2 + + local walldef = { + drawtype = "mesh", + mesh = def.mesh_wall, + tiles = def.tiles, + use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + light_source = def.light, + groups = groups_wall, + drop = def.drop or itemstring, + selection_box = { + type = "wallmounted", + wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1}, + wall_side = {-0.5, -0.5, -0.1, -0.2, 0.1, 0.1}, + }, + sounds = def.sounds, + on_rotate = false, + on_construct = def.particles and spawn_flames_wall, + on_destruct = def.particles and remove_flames, + } + minetest.register_node(itemstring_wall, walldef) + + -- Add entry alias for the Help + if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", itemstring, "nodes", itemstring_wall) + end +end + +minetest.register_lbm({ + label = "Torch flame particles", + name = "mcl_torches:flames", + nodenames = {"group:torch_particles"}, + run_at_every_load = true, + action = function(pos, node) + local torch_group = minetest.get_item_group(node.name, "torch") + if torch_group == 1 then + spawn_flames_floor(pos) + elseif torch_group == 2 then + spawn_flames_wall(pos) + end + end, +}) diff --git a/mods/ITEMS/mcl_torches/init.lua b/mods/ITEMS/mcl_torches/init.lua index 451a8dfad..1102731c1 100644 --- a/mods/ITEMS/mcl_torches/init.lua +++ b/mods/ITEMS/mcl_torches/init.lua @@ -1,338 +1,6 @@ -local S = minetest.get_translator("mcl_torches") -local LIGHT_TORCH = minetest.LIGHT_MAX - -local spawn_flames_floor = function(pos) - -- Flames - mcl_particles.add_node_particlespawner(pos, { - amount = 8, - time = 0, - minpos = vector.add(pos, { x = -0.1, y = 0.05, z = -0.1 }), - maxpos = vector.add(pos, { x = 0.1, y = 0.15, z = 0.1 }), - minvel = { x = -0.01, y = 0, z = -0.01 }, - maxvel = { x = 0.01, y = 0.1, z = 0.01 }, - minexptime = 0.3, - maxexptime = 0.6, - minsize = 0.7, - maxsize = 2, - texture = "mcl_particles_flame.png", - glow = LIGHT_TORCH, - }, "low") - -- Smoke - mcl_particles.add_node_particlespawner(pos, { - amount = 0.5, - time = 0, - minpos = vector.add(pos, { x = -1/16, y = 0.04, z = -1/16 }), - maxpos = vector.add(pos, { x = -1/16, y = 0.06, z = -1/16 }), - minvel = { x = 0, y = 0.5, z = 0 }, - maxvel = { x = 0, y = 0.6, z = 0 }, - minexptime = 2.0, - maxexptime = 2.0, - minsize = 1.5, - maxsize = 1.5, - texture = "mcl_particles_smoke_anim.png", - animation = { - type = "vertical_frames", - aspect_w = 8, - aspect_h = 8, - length = 2.05, - }, - }, "medium") -end - -local spawn_flames_wall = function(pos, param2) - local minrelpos, maxrelpos - local dir = minetest.wallmounted_to_dir(param2) - if dir.x < 0 then - minrelpos = { x = -0.38, y = 0.04, z = -0.1 } - maxrelpos = { x = -0.2, y = 0.14, z = 0.1 } - elseif dir.x > 0 then - minrelpos = { x = 0.2, y = 0.04, z = -0.1 } - maxrelpos = { x = 0.38, y = 0.14, z = 0.1 } - elseif dir.z < 0 then - minrelpos = { x = -0.1, y = 0.04, z = -0.38 } - maxrelpos = { x = 0.1, y = 0.14, z = -0.2 } - elseif dir.z > 0 then - minrelpos = { x = -0.1, y = 0.04, z = 0.2 } - maxrelpos = { x = 0.1, y = 0.14, z = 0.38 } - else - return - end - -- Flames - mcl_particles.add_node_particlespawner(pos, { - amount = 8, - time = 0, - minpos = vector.add(pos, minrelpos), - maxpos = vector.add(pos, maxrelpos), - minvel = { x = -0.01, y = 0, z = -0.01 }, - maxvel = { x = 0.01, y = 0.1, z = 0.01 }, - minexptime = 0.3, - maxexptime = 0.6, - minsize = 0.7, - maxsize = 2, - texture = "mcl_particles_flame.png", - glow = LIGHT_TORCH, - }, "low") - -- Smoke - mcl_particles.add_node_particlespawner(pos, { - amount = 0.5, - time = 0, - minpos = vector.add(pos, minrelpos), - maxpos = vector.add(pos, maxrelpos), - minvel = { x = 0, y = 0.5, z = 0 }, - maxvel = { x = 0, y = 0.6, z = 0 }, - minexptime = 2.0, - maxexptime = 2.0, - minsize = 1.5, - maxsize = 1.5, - texture = "mcl_particles_smoke_anim.png", - animation = { - type = "vertical_frames", - aspect_w = 8, - aspect_h = 8, - length = 2.05, - }, - }, "medium") -end - -local remove_flames = function(pos) - mcl_particles.delete_node_particlespawners(pos) -end - --- --- 3d torch part --- - --- Check if placement at given node is allowed -local function check_placement_allowed(node, wdir) - -- Torch placement rules: Disallow placement on some nodes. General rule: Solid, opaque, full cube collision box nodes are allowed. - -- Special allowed nodes: - -- * soul sand - -- * mob spawner - -- * chorus flower - -- * glass, barrier, ice - -- * Fence, wall, end portal frame with ender eye: Only on top - -- * Slab, stairs: Only on top if upside down - - -- Special forbidden nodes: - -- * Piston, sticky piston - local def = minetest.registered_nodes[node.name] - if not def then - return false - -- No ceiling torches - elseif wdir == 0 then - return false - elseif not def.buildable_to then - if node.name ~= "mcl_core:ice" and node.name ~= "mcl_nether:soul_sand" and node.name ~= "mcl_mobspawners:spawner" and node.name ~= "mcl_core:barrier" and node.name ~= "mcl_end:chorus_flower" and node.name ~= "mcl_end:chorus_flower_dead" and (not def.groups.glass) and - ((not def.groups.solid) or (not def.groups.opaque)) then - -- Only allow top placement on these nodes - if node.name == "mcl_end:dragon_egg" or node.name == "mcl_portals:end_portal_frame_eye" or def.groups.fence == 1 or def.groups.wall or def.groups.slab_top == 1 or def.groups.anvil or def.groups.pane or (def.groups.stair == 1 and minetest.facedir_to_dir(node.param2).y ~= 0) then - if wdir ~= 1 then - return false - end - else - return false - end - elseif minetest.get_item_group(node.name, "piston") >= 1 then - return false - end - end - return true -end - mcl_torches = {} -mcl_torches.register_torch = function(substring, description, doc_items_longdesc, doc_items_usagehelp, icon, mesh_floor, mesh_wall, tiles, light, groups, sounds, moredef, moredef_floor, moredef_wall) - local itemstring = minetest.get_current_modname()..":"..substring - local itemstring_wall = minetest.get_current_modname()..":"..substring.."_wall" - - if light == nil then light = minetest.LIGHT_MAX end - if mesh_floor == nil then mesh_floor = "mcl_torches_torch_floor.obj" end - if mesh_wall == nil then mesh_wall = "mcl_torches_torch_wall.obj" end - if groups == nil then groups = {} end - - groups.attached_node = 1 - groups.torch = 1 - groups.dig_by_water = 1 - groups.destroy_by_lava_flow = 1 - groups.dig_by_piston = 1 - - local floordef = { - description = description, - _doc_items_longdesc = doc_items_longdesc, - _doc_items_usagehelp = doc_items_usagehelp, - drawtype = "mesh", - mesh = mesh_floor, - inventory_image = icon, - wield_image = icon, - tiles = tiles, - use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, - paramtype = "light", - paramtype2 = "wallmounted", - sunlight_propagates = true, - is_ground_content = false, - walkable = false, - liquids_pointable = false, - light_source = light, - groups = groups, - drop = itemstring, - selection_box = { - type = "wallmounted", - wall_top = {-1/16, -1/16, -1/16, 1/16, 0.5, 1/16}, - wall_bottom = {-1/16, -0.5, -1/16, 1/16, 1/16, 1/16}, - }, - sounds = sounds, - node_placement_prediction = "", - on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - -- no interaction possible with entities, for now. - return itemstack - end - - local under = pointed_thing.under - local node = minetest.get_node(under) - local def = minetest.registered_nodes[node.name] - if not def then return itemstack end - - -- Call on_rightclick if the pointed node defines it - if placer and not placer:get_player_control().sneak then - if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then - return minetest.registered_nodes[node.name].on_rightclick(under, node, placer, itemstack) or itemstack - end - end - - local above = pointed_thing.above - local wdir = minetest.dir_to_wallmounted({x = under.x - above.x, y = under.y - above.y, z = under.z - above.z}) - - if check_placement_allowed(node, wdir) == false then - return itemstack - end - - local itemstring = itemstack:get_name() - local fakestack = ItemStack(itemstack) - local idef = fakestack:get_definition() - local retval - - if wdir == 1 then - retval = fakestack:set_name(itemstring) - else - retval = fakestack:set_name(itemstring_wall) - end - if not retval then - return itemstack - end - - local success - itemstack, success = minetest.item_place(fakestack, placer, pointed_thing, wdir) - itemstack:set_name(itemstring) - - if success and idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=under, gain=1}, true) - end - return itemstack - end, - on_rotate = false, - } - if moredef ~= nil then - for k,v in pairs(moredef) do - floordef[k] = v - end - end - if moredef_floor ~= nil then - for k,v in pairs(moredef_floor) do - floordef[k] = v - end - end - minetest.register_node(itemstring, floordef) - - local groups_wall = table.copy(groups) - groups_wall.torch = 2 - - local walldef = { - drawtype = "mesh", - mesh = mesh_wall, - tiles = tiles, - use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, - paramtype = "light", - paramtype2 = "wallmounted", - sunlight_propagates = true, - is_ground_content = false, - walkable = false, - light_source = light, - groups = groups_wall, - drop = itemstring, - selection_box = { - type = "wallmounted", - wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1}, - wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1}, - wall_side = {-0.5, -0.5, -0.1, -0.2, 0.1, 0.1}, - }, - sounds = sounds, - on_rotate = false, - } - if moredef ~= nil then - for k,v in pairs(moredef) do - walldef[k] = v - end - end - if moredef_wall ~= nil then - for k,v in pairs(moredef_wall) do - walldef[k] = v - end - end - minetest.register_node(itemstring_wall, walldef) - - - -- Add entry alias for the Help - if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", itemstring, "nodes", itemstring_wall) - end - -end - -mcl_torches.register_torch("torch", - S("Torch"), - S("Torches are light sources which can be placed at the side or on the top of most blocks."), - nil, - "default_torch_on_floor.png", - "mcl_torches_torch_floor.obj", "mcl_torches_torch_wall.obj", - {{ - name = "default_torch_on_floor_animated.png", - animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} - }}, - LIGHT_TORCH, - {dig_immediate=3, torch=1, deco_block=1}, - mcl_sounds.node_sound_wood_defaults(), - {_doc_items_hidden = false, - on_destruct = function(pos) - remove_flames(pos) - end}, - {on_construct = function(pos) - spawn_flames_floor(pos) - end}, - {on_construct = function(pos) - local node = minetest.get_node(pos) - spawn_flames_wall(pos, node.param2) - end}) - -minetest.register_craft({ - output = "mcl_torches:torch 4", - recipe = { - { "group:coal" }, - { "mcl_core:stick" }, - } -}) - -minetest.register_lbm({ - label = "Torch flame particles", - name = "mcl_torches:flames", - nodenames = {"mcl_torches:torch", "mcl_torches:torch_wall"}, - run_at_every_load = true, - action = function(pos, node) - if node.name == "mcl_torches:torch" then - spawn_flames_floor(pos) - elseif node.name == "mcl_torches:torch_wall" then - spawn_flames_wall(pos, node.param2) - end - end, -}) +local modpath = minetest.get_modpath("mcl_torches") +dofile(modpath .. "/api.lua") +dofile(modpath .. "/register.lua") diff --git a/mods/ITEMS/mcl_torches/register.lua b/mods/ITEMS/mcl_torches/register.lua new file mode 100644 index 000000000..4218889d9 --- /dev/null +++ b/mods/ITEMS/mcl_torches/register.lua @@ -0,0 +1,27 @@ +local S = minetest.get_translator("mcl_torches") + +mcl_torches.register_torch({ + name = "torch", + description = S("Torch"), + doc_items_longdesc = S("Torches are light sources which can be placed at the side or on the top of most blocks."), + doc_items_hidden = false, + icon = "default_torch_on_floor.png", + tiles = {{ + name = "default_torch_on_floor_animated.png", + animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} + }}, + -- this is 15 in minecraft + light = 14, + groups = {dig_immediate = 3, deco_block = 1}, + sounds = mcl_sounds.node_sound_wood_defaults(), + particles = true, +}) + +minetest.register_craft({ + output = "mcl_torches:torch 4", + recipe = { + {"group:coal"}, + {"mcl_core:stick"}, + } +}) + diff --git a/mods/ITEMS/mcl_walls/init.lua b/mods/ITEMS/mcl_walls/init.lua index 36694c6f3..de1b1760f 100644 --- a/mods/ITEMS/mcl_walls/init.lua +++ b/mods/ITEMS/mcl_walls/init.lua @@ -151,7 +151,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory minetest.register_node(nodename.."_"..i, { collision_box = { - type = 'fixed', + type = 'fixed', fixed = {-4/16, -0.5, -4/16, 4/16, 1, 4/16} }, drawtype = "nodebox", @@ -180,7 +180,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory minetest.register_node(nodename.."_16", { drawtype = "nodebox", collision_box = { - type = 'fixed', + type = 'fixed', fixed = {-4/16, -0.5, -4/16, 4/16, 1, 4/16} }, tiles = tiles, @@ -206,7 +206,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory minetest.register_node(nodename.."_21", { drawtype = "nodebox", collision_box = { - type = 'fixed', + type = 'fixed', fixed = {-4/16, -0.5, -4/16, 4/16, 1, 4/16} }, tiles = tiles, @@ -247,7 +247,7 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory fixed = pillar }, collision_box = { - type = 'fixed', + type = 'fixed', fixed = {-4/16, -0.5, -4/16, 4/16, 1, 4/16} }, collisionbox = {-0.2, 0, -0.2, 0.2, 1.4, 0.2}, diff --git a/mods/ITEMS/mcl_wool/locale/mcl_wool.de.tr b/mods/ITEMS/mcl_wool/locale/mcl_wool.de.tr index 5b979d51b..9f67a52fb 100644 --- a/mods/ITEMS/mcl_wool/locale/mcl_wool.de.tr +++ b/mods/ITEMS/mcl_wool/locale/mcl_wool.de.tr @@ -22,7 +22,7 @@ Blue Carpet=Blauer Teppich Magenta Wool=Magenta Wolle Magenta Carpet=Magenta Teppich Orange Wool=Orange Wolle -Orange Carpet=Orange Teppich +Orange Carpet=Oranger Teppich Purple Wool=Violette Wolle Purple Carpet=Violetter Teppich Brown Wool=Braune Wolle diff --git a/mods/ITEMS/screwdriver/init.lua b/mods/ITEMS/screwdriver/init.lua index e6aedf19c..942bccf38 100644 --- a/mods/ITEMS/screwdriver/init.lua +++ b/mods/ITEMS/screwdriver/init.lua @@ -157,7 +157,6 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses) if should_rotate and new_param2 ~= node.param2 then node.param2 = new_param2 minetest.swap_node(pos, node) - minetest.check_for_falling(pos) if ndef.after_rotate then ndef.after_rotate(vector.new(pos)) diff --git a/mods/ITEMS/screwdriver/locale/screwdriver.de.tr b/mods/ITEMS/screwdriver/locale/screwdriver.de.tr index 35c99c05f..eaf44b0d6 100644 --- a/mods/ITEMS/screwdriver/locale/screwdriver.de.tr +++ b/mods/ITEMS/screwdriver/locale/screwdriver.de.tr @@ -1,2 +1,2 @@ # textdomain: screwdriver -Screwdriver=Schraubendreher +Screwdriver=Schraubenzieher diff --git a/mods/ITEMS/xpanes/init.lua b/mods/ITEMS/xpanes/init.lua index e1914a9ff..b7faffb3b 100644 --- a/mods/ITEMS/xpanes/init.lua +++ b/mods/ITEMS/xpanes/init.lua @@ -142,7 +142,7 @@ function xpanes.register_pane(name, def) tiles = {def.textures[3], def.textures[2], def.textures[1]}, use_texture_alpha = def.use_texture_alpha, groups = groups, - drop = "xpanes:" .. name .. "_flat", + drop = drop, sounds = def.sounds, node_box = { type = "connected", @@ -153,7 +153,6 @@ function xpanes.register_pane(name, def) connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}}, }, connects_to = {"group:pane", "group:stone", "group:glass", "group:wood", "group:tree"}, - drop = drop, _mcl_blast_resistance = def._mcl_blast_resistance, _mcl_hardness = def._mcl_hardness, _mcl_silk_touch_drop = def._mcl_silk_touch_drop and {"xpanes:" .. name .. "_flat"}, diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 5f0510344..f583d87b6 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -3906,7 +3906,7 @@ end -- Decorations in non-Overworld dimensions local function register_dimension_decorations() --[[ NETHER ]] - -- TODO: Nether + -- TODO: Nether --[[ THE END ]] @@ -3973,7 +3973,7 @@ if mg_name ~= "singlenode" then if deco_id_chorus_plant then mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed) local gennotify = minetest.get_mapgen_object("gennotify") - local poslist = {} + --local poslist = {} for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do local realpos = { x = pos.x, y = pos.y + 1, z = pos.z } mcl_end.grow_chorus_plant(realpos) diff --git a/mods/MAPGEN/mcl_dungeons/init.lua b/mods/MAPGEN/mcl_dungeons/init.lua index 928faaa11..58e23b12e 100644 --- a/mods/MAPGEN/mcl_dungeons/init.lua +++ b/mods/MAPGEN/mcl_dungeons/init.lua @@ -49,12 +49,12 @@ local dungeonsizes = { { x=7, y=4, z=7}, } -local dirs = { +--[[local dirs = { { x= 1, y=0, z= 0 }, { x= 0, y=0, z= 1 }, { x=-1, y=0, z= 0 }, { x= 0, y=0, z=-1 }, -} +}]] local surround_vectors = { { x=-1, y=0, z=0 }, @@ -66,7 +66,7 @@ local surround_vectors = { local function ecb_spawn_dungeon(blockpos, action, calls_remaining, param) if calls_remaining >= 1 then return end - local p1, p2, dim, pr = param.p1, param.p2, param.dim, param.pr + local p1, _, dim, pr = param.p1, param.p2, param.dim, param.pr local x, y, z = p1.x, p1.y, p1.z local check = not (param.dontcheck or false) @@ -404,8 +404,7 @@ local function dungeons_nodes(minp, maxp, blockseed) local p1 = {x=x,y=y,z=z} local p2 = {x = x+dim.x+1, y = y+dim.y+1, z = z+dim.z+1} minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) - local param = {p1=p1, p2=p2, dim=dim, pr=pr} - emerge_area(p1, p2, ecb_spawn_dungeon, param) + emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr}) end end @@ -414,8 +413,7 @@ function mcl_dungeons.spawn_dungeon(p1, _, pr) local dim = dungeonsizes[pr:next(1, #dungeonsizes)] local p2 = {x = p1.x+dim.x+1, y = p1.y+dim.y+1, z = p1.z+dim.z+1} minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) - local param = {p1=p1, p2=p2, dim=dim, pr=pr, dontcheck=true} - emerge_area(p1, p2, ecb_spawn_dungeon, param) + emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr, dontcheck=true}) end mcl_mapgen_core.register_generator("dungeons", nil, dungeons_nodes, 999999) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 1ee861e4a..90b272506 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -65,21 +65,21 @@ local c_dirt = minetest.get_content_id("mcl_core:dirt") local c_dirt_with_grass = minetest.get_content_id("mcl_core:dirt_with_grass") local c_dirt_with_grass_snow = minetest.get_content_id("mcl_core:dirt_with_grass_snow") local c_sand = minetest.get_content_id("mcl_core:sand") -local c_sandstone = minetest.get_content_id("mcl_core:sandstone") +--local c_sandstone = minetest.get_content_id("mcl_core:sandstone") local c_void = minetest.get_content_id("mcl_core:void") local c_lava = minetest.get_content_id("mcl_core:lava_source") local c_water = minetest.get_content_id("mcl_core:water_source") local c_soul_sand = minetest.get_content_id("mcl_nether:soul_sand") local c_netherrack = minetest.get_content_id("mcl_nether:netherrack") local c_nether_lava = minetest.get_content_id("mcl_nether:nether_lava_source") -local c_end_stone = minetest.get_content_id("mcl_end:end_stone") +--local c_end_stone = minetest.get_content_id("mcl_end:end_stone") local c_realm_barrier = minetest.get_content_id("mcl_core:realm_barrier") local c_top_snow = minetest.get_content_id("mcl_core:snow") local c_snow_block = minetest.get_content_id("mcl_core:snowblock") local c_clay = minetest.get_content_id("mcl_core:clay") local c_leaves = minetest.get_content_id("mcl_core:leaves") local c_jungleleaves = minetest.get_content_id("mcl_core:jungleleaves") -local c_jungletree = minetest.get_content_id("mcl_core:jungletree") +--local c_jungletree = minetest.get_content_id("mcl_core:jungletree") local c_cocoa_1 = minetest.get_content_id("mcl_cocoas:cocoa_1") local c_cocoa_2 = minetest.get_content_id("mcl_cocoas:cocoa_2") local c_cocoa_3 = minetest.get_content_id("mcl_cocoas:cocoa_3") @@ -1169,13 +1169,13 @@ end -- minp and maxp (from an on_generated callback) and returns the real world coordinates -- as X, Z. -- Inverse function of xz_to_biomemap -local biomemap_to_xz = function(index, minp, maxp) +--[[local biomemap_to_xz = function(index, minp, maxp) local xwidth = maxp.x - minp.x + 1 local zwidth = maxp.z - minp.z + 1 local x = ((index-1) % xwidth) + minp.x local z = ((index-1) / zwidth) + minp.z return x, z -end +end]] -- Takes x and z coordinates and minp and maxp of a generated chunk -- (in on_generated callback) and returns a biomemap index) @@ -1897,7 +1897,7 @@ function mcl_mapgen_core.unregister_generator(id) local rec = registered_generators[id] registered_generators[id] = nil if rec.vf then lvm = lvm - 1 end - if rev.nf then nodes = nodes - 1 end + if rec.nf then nodes = nodes - 1 end if rec.needs_param2 then param2 = param2 - 1 end if rec.needs_level0 then level0 = level0 - 1 end end @@ -1979,7 +1979,7 @@ end -- Below the bedrock, generate air/void local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) - local biomemap, ymin, ymax + local biomemap --ymin, ymax local lvm_used = false local pr = PseudoRandom(blockseed) @@ -2077,7 +2077,7 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) local n = nodes[n] local p_pos = area:index(n.x, n.y, n.z) local p_pos_above = area:index(n.x, n.y+1, n.z) - local p_pos_below = area:index(n.x, n.y-1, n.z) + --local p_pos_below = area:index(n.x, n.y-1, n.z) local b_pos = aream:index(n.x, 0, n.z) local bn = minetest.get_biome_name(biomemap[b_pos]) if bn then @@ -2126,7 +2126,7 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) -- * Remove stone, sand, dirt in v6 so our End map generator works in v6. -- * Generate spawn platform (End portal destination) elseif minp.y <= mcl_vars.mg_end_max and maxp.y >= mcl_vars.mg_end_min then - local nodes, n + local nodes if mg_name == "v6" then nodes = minetest.find_nodes_in_area(emin, emax, {"mcl_core:water_source", "mcl_core:stone", "mcl_core:sand", "mcl_core:dirt"}) else @@ -2134,7 +2134,7 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) end if #nodes > 0 then lvm_used = true - for _, n in pairs(nodes) do + for _,n in pairs(nodes) do data[area:index(n.x, n.y, n.z)] = c_air end end @@ -2144,8 +2144,8 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) minp.x <= mcl_vars.mg_end_platform_pos.x and maxp.x >= mcl_vars.mg_end_platform_pos.z and minp.z <= mcl_vars.mg_end_platform_pos.z and maxp.z >= mcl_vars.mg_end_platform_pos.z then - local pos1 = {x = math.max(minp.x, mcl_vars.mg_end_platform_pos.x-2), y = math.max(minp.y, mcl_vars.mg_end_platform_pos.y), z = math.max(minp.z, mcl_vars.mg_end_platform_pos.z-2)} - local pos2 = {x = math.min(maxp.x, mcl_vars.mg_end_platform_pos.x+2), y = math.min(maxp.y, mcl_vars.mg_end_platform_pos.y+2), z = math.min(maxp.z, mcl_vars.mg_end_platform_pos.z+2)} + --local pos1 = {x = math.max(minp.x, mcl_vars.mg_end_platform_pos.x-2), y = math.max(minp.y, mcl_vars.mg_end_platform_pos.y), z = math.max(minp.z, mcl_vars.mg_end_platform_pos.z-2)} + --local pos2 = {x = math.min(maxp.x, mcl_vars.mg_end_platform_pos.x+2), y = math.min(maxp.y, mcl_vars.mg_end_platform_pos.y+2), z = math.min(maxp.z, mcl_vars.mg_end_platform_pos.z+2)} for x=math.max(minp.x, mcl_vars.mg_end_platform_pos.x-2), math.min(maxp.x, mcl_vars.mg_end_platform_pos.x+2) do for z=math.max(minp.z, mcl_vars.mg_end_platform_pos.z-2), math.min(maxp.z, mcl_vars.mg_end_platform_pos.z+2) do diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index b7afd18bb..e3f6b4829 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -110,7 +110,8 @@ mcl_structures.generate_igloo = function(pos, rotation, pr) if r == 1 then -- Select basement depth local dim = mcl_worlds.pos_to_dimension(pos) - local buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + --local buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + local buffer if dim == "nether" then buffer = pos.y - (mcl_vars.mg_lava_nether_max + 10) elseif dim == "end" then @@ -219,7 +220,7 @@ local function igloo_placement_callback(p1, p2, size, orientation, pr) else return end - local size = {x=9,y=5,z=7} + --local size = {x=9,y=5,z=7} local lootitems = mcl_loot.get_multi_loot({ { stacks_min = 1, @@ -335,7 +336,7 @@ local function shrine_placement_callback(p1, p2, size, rotation, pr) -- Find and setup spawner with silverfish local spawners = minetest.find_nodes_in_area(p1, p2, "mcl_mobspawners:spawner") for s=1, #spawners do - local meta = minetest.get_meta(spawners[s]) + --local meta = minetest.get_meta(spawners[s]) mcl_mobspawners.setup_spawner(spawners[s], "mobs_mc:silverfish") end @@ -411,7 +412,7 @@ end mcl_structures.generate_end_portal_shrine = function(pos, rotation, pr) local offset = {x=6, y=4, z=6} - local size = {x=13, y=8, z=13} + --local size = {x=13, y=8, z=13} local newpos = { x = pos.x - offset.x, y = pos.y, z = pos.z - offset.z } local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_end_portal_room_simple.mts" @@ -471,8 +472,6 @@ local function temple_placement_callback(p1, p2, size, rotation, pr) { itemstring = "mcl_mobitems:string", weight = 10, amount_min = 1, amount_max = 8 }, } }}, pr) - - local meta = minetest.get_meta(chests[c]) init_node_construct(chests[c]) local meta = minetest.get_meta(chests[c]) local inv = meta:get_inventory() @@ -498,7 +497,7 @@ mcl_structures.generate_desert_temple = function(pos, rotation, pr) -- No Generating for the temple ... Why using it ? No Change local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_desert_temple.mts" local newpos = {x=pos.x,y=pos.y-12,z=pos.z} - local size = {x=22, y=24, z=22} + --local size = {x=22, y=24, z=22} if newpos == nil then return end diff --git a/mods/MAPGEN/mcl_villages/buildings.lua b/mods/MAPGEN/mcl_villages/buildings.lua index e43db6d98..9d8e7580f 100644 --- a/mods/MAPGEN/mcl_villages/buildings.lua +++ b/mods/MAPGEN/mcl_villages/buildings.lua @@ -12,19 +12,19 @@ function settlements.build_schematic(vm, data, va, pos, building, replace_wall, -- pick random material local material = wallmaterial[math.random(1,#wallmaterial)] -- schematic conversion to lua - local schem_lua = minetest.serialize_schematic(building, - "lua", + local schem_lua = minetest.serialize_schematic(building, + "lua", {lua_use_comments = false, lua_num_indent_spaces = 0}).." return(schematic)" -- replace material if replace_wall == "y" then schem_lua = schem_lua:gsub("mcl_core:cobble", material) end - schem_lua = schem_lua:gsub("mcl_core:dirt_with_grass", + schem_lua = schem_lua:gsub("mcl_core:dirt_with_grass", platform_material) -- Disable special junglewood for now. -- special material for spawning npcs - -- schem_lua = schem_lua:gsub("mcl_core:junglewood", + -- schem_lua = schem_lua:gsub("mcl_core:junglewood", -- "settlements:junglewood") -- @@ -37,25 +37,25 @@ function settlements.build_schematic(vm, data, va, pos, building, replace_wall, local possible_rotations = {"0", "90", "180", "270"} local rotation = possible_rotations[ math.random( #possible_rotations ) ] settlements.foundation( - pos, - width, - depth, - height, + pos, + width, + depth, + height, rotation) vm:set_data(data) -- place schematic minetest.place_schematic_on_vmanip( - vm, - pos, - schematic, - rotation, - nil, + vm, + pos, + schematic, + rotation, + nil, true) vm:write_to_map(true) end]] ------------------------------------------------------------------------------- --- initialize settlement_info +-- initialize settlement_info ------------------------------------------------------------------------------- function settlements.initialize_settlement_info(pr) local count_buildings = {} @@ -81,10 +81,10 @@ function settlements.create_site_plan(maxp, minp, pr) local possible_rotations = {"0", "90", "180", "270"} -- find center of chunk local center = { - x=math.floor((minp.x+maxp.x)/2), - y=maxp.y, + x=math.floor((minp.x+maxp.x)/2), + y=maxp.y, z=math.floor((minp.z+maxp.z)/2) - } + } -- find center_surface of chunk local center_surface , surface_material = settlements.find_surface(center, true) local chunks = {} @@ -105,8 +105,8 @@ function settlements.create_site_plan(maxp, minp, pr) -- add to settlement info table local index = 1 settlement_info[index] = { - pos = center_surface, - name = building_all_info["name"], + pos = center_surface, + name = building_all_info["name"], hsize = building_all_info["hsize"], rotat = rotation, surface_mat = surface_material @@ -149,8 +149,8 @@ function settlements.create_site_plan(maxp, minp, pr) rotation = possible_rotations[ pr:next(1, #possible_rotations ) ] number_built = number_built + 1 settlement_info[index] = { - pos = pos_surface, - name = building_all_info["name"], + pos = pos_surface, + name = building_all_info["name"], hsize = building_all_info["hsize"], rotat = rotation, surface_mat = surface_material @@ -215,10 +215,10 @@ function settlements.place_schematics(settlement_info, pr) end end - local pos = settlement_info[i]["pos"] - local rotation = settlement_info[i]["rotat"] + local pos = settlement_info[i]["pos"] + local rotation = settlement_info[i]["rotat"] -- get building node material for better integration to surrounding - local platform_material = settlement_info[i]["surface_mat"] + local platform_material = settlement_info[i]["surface_mat"] --platform_material_name = minetest.get_name_from_content_id(platform_material) -- pick random material --local material = wallmaterial[pr:next(1,#wallmaterial)] @@ -226,8 +226,8 @@ function settlements.place_schematics(settlement_info, pr) local building = building_all_info["mts"] local replace_wall = building_all_info["rplc"] -- schematic conversion to lua - local schem_lua = minetest.serialize_schematic(building, - "lua", + local schem_lua = minetest.serialize_schematic(building, + "lua", {lua_use_comments = false, lua_num_indent_spaces = 0}).." return(schematic)" schem_lua = schem_lua:gsub("mcl_core:stonebrickcarved", "mcl_villages:stonebrickcarved") -- replace material @@ -269,10 +269,10 @@ function settlements.place_schematics(settlement_info, pr) -- build foundation for the building an make room above -- place schematic mcl_structures.place_schematic( - pos, - schematic, - rotation, - nil, + pos, + schematic, + rotation, + nil, true, nil, init_nodes, diff --git a/mods/MAPGEN/mcl_villages/const.lua b/mods/MAPGEN/mcl_villages/const.lua index 4e2b39136..6621dbf3a 100644 --- a/mods/MAPGEN/mcl_villages/const.lua +++ b/mods/MAPGEN/mcl_villages/const.lua @@ -8,15 +8,15 @@ end --[[ Manually set in 'buildings.lua' -- material to replace cobblestone with wallmaterial = { - "mcl_core:junglewood", - "mcl_core:sprucewood", - "mcl_core:wood", - "mcl_core:birchwood", - "mcl_core:acaciawood", - "mcl_core:stonebrick", - "mcl_core:cobble", - "mcl_core:sandstonecarved", - "mcl_core:sandstone", + "mcl_core:junglewood", + "mcl_core:sprucewood", + "mcl_core:wood", + "mcl_core:birchwood", + "mcl_core:acaciawood", + "mcl_core:stonebrick", + "mcl_core:cobble", + "mcl_core:sandstonecarved", + "mcl_core:sandstone", "mcl_core:sandstonesmooth2" } --]] @@ -78,4 +78,4 @@ max_height_difference = 56 -- -- half_map_chunk_size = 40 -quarter_map_chunk_size = 20 +--quarter_map_chunk_size = 20 diff --git a/mods/MAPGEN/mcl_villages/foundation.lua b/mods/MAPGEN/mcl_villages/foundation.lua index 038a2f202..71c5cfdda 100644 --- a/mods/MAPGEN/mcl_villages/foundation.lua +++ b/mods/MAPGEN/mcl_villages/foundation.lua @@ -9,15 +9,15 @@ function settlements.ground(pos, pr) -- role model: Wendelsteinkircherl, Brannen while true do cnt = cnt+1 if cnt > 20 then break end - if cnt>pr:next(2,4) then - mat = "mcl_core:stone" + if cnt>pr:next(2,4) then + mat = "mcl_core:stone" end minetest.swap_node(p2, {name=mat}) p2.y = p2.y-1 end end ------------------------------------------------------------------------------- --- function clear space above baseplate +-- function clear space above baseplate ------------------------------------------------------------------------------- function settlements.terraform(settlement_info, pr) local fheight, fwidth, fdepth, schematic_data @@ -30,7 +30,7 @@ function settlements.terraform(settlement_info, pr) break end end - local pos = settlement_info[i]["pos"] + local pos = settlement_info[i]["pos"] if settlement_info[i]["rotat"] == "0" or settlement_info[i]["rotat"] == "180" then fwidth = schematic_data["hwidth"] fdepth = schematic_data["hdepth"] @@ -54,9 +54,9 @@ function settlements.terraform(settlement_info, pr) -- local p = {x=pos.x+xi, y=pos.y+yi, z=pos.z+zi} -- local node = mcl_vars.get_node(p) -- if node and node.name ~= "air" then --- minetest.swap_node(p,{name="air"}) +-- minetest.swap_node(p,{name="air"}) -- end - minetest.swap_node({x=pos.x+xi, y=pos.y+yi, z=pos.z+zi},{name="air"}) + minetest.swap_node({x=pos.x+xi, y=pos.y+yi, z=pos.z+zi},{name="air"}) end end end diff --git a/mods/MAPGEN/mcl_villages/init.lua b/mods/MAPGEN/mcl_villages/init.lua index 19de10b98..ccc3f585d 100644 --- a/mods/MAPGEN/mcl_villages/init.lua +++ b/mods/MAPGEN/mcl_villages/init.lua @@ -46,7 +46,7 @@ if minetest.get_modpath("mobs_mc") ~= nil then 7, --active_object_count 31000, --max_height nil) --day_toggle -end +end --]] -- @@ -85,7 +85,7 @@ if mg_name ~= "singlenode" then if blockseed % 77 ~= 17 then return end -- needed for manual and automated settlement building -- don't build settlements on (too) uneven terrain - local heightmap = minetest.get_mapgen_object("heightmap") + --local heightmap = minetest.get_mapgen_object("heightmap") local height_difference = settlements.evaluate_heightmap() if height_difference > max_height_difference then return end diff --git a/mods/MAPGEN/mcl_villages/paths.lua b/mods/MAPGEN/mcl_villages/paths.lua index 4973171a6..63f2ba146 100644 --- a/mods/MAPGEN/mcl_villages/paths.lua +++ b/mods/MAPGEN/mcl_villages/paths.lua @@ -6,10 +6,10 @@ function settlements.paths(settlement_info) local end_point local distance --for k,v in pairs(settlement_info) do - starting_point = settlement_info[1]["pos"] + starting_point = settlement_info[1]["pos"] for o,p in pairs(settlement_info) do - end_point = settlement_info[o]["pos"] + end_point = settlement_info[o]["pos"] if starting_point ~= end_point then -- loop until end_point is reched (distance == 0) @@ -40,35 +40,35 @@ function settlements.paths(settlement_info) -- evaluate which pos is closer to the end_point if dist_north_p_to_end <= dist_south_p_to_end and dist_north_p_to_end <= dist_west_p_to_end and - dist_north_p_to_end <= dist_east_p_to_end + dist_north_p_to_end <= dist_east_p_to_end then starting_point = north_p distance = dist_north_p_to_end elseif dist_south_p_to_end <= dist_north_p_to_end and dist_south_p_to_end <= dist_west_p_to_end and - dist_south_p_to_end <= dist_east_p_to_end + dist_south_p_to_end <= dist_east_p_to_end then starting_point = south_p distance = dist_south_p_to_end elseif dist_west_p_to_end <= dist_north_p_to_end and dist_west_p_to_end <= dist_south_p_to_end and - dist_west_p_to_end <= dist_east_p_to_end + dist_west_p_to_end <= dist_east_p_to_end then starting_point = west_p distance = dist_west_p_to_end elseif dist_east_p_to_end <= dist_north_p_to_end and dist_east_p_to_end <= dist_south_p_to_end and - dist_east_p_to_end <= dist_west_p_to_end + dist_east_p_to_end <= dist_west_p_to_end then starting_point = east_p distance = dist_east_p_to_end end -- find surface of new starting point local surface_point, surface_mat = settlements.find_surface(starting_point) - -- replace surface node with mcl_core:grass_path + -- replace surface node with mcl_core:grass_path if surface_point then if surface_mat == "mcl_core:sand" or surface_mat == "mcl_core:redsand" then diff --git a/mods/MAPGEN/mcl_villages/utils.lua b/mods/MAPGEN/mcl_villages/utils.lua index d7617541d..993de11c4 100644 --- a/mods/MAPGEN/mcl_villages/utils.lua +++ b/mods/MAPGEN/mcl_villages/utils.lua @@ -126,7 +126,7 @@ function settlements.fill_chest(pos, pr) -- fill chest local inv = minetest.get_inventory( {type="node", pos=pos} ) - local function get_treasures(pr) + local function get_treasures(prand) local loottable = {{ stacks_min = 3, stacks_max = 8, @@ -150,7 +150,7 @@ function settlements.fill_chest(pos, pr) { itemstring = "mobs_mc:diamond_horse_armor", weight = 1 }, } }} - local items = mcl_loot.get_multi_loot(loottable, pr) + local items = mcl_loot.get_multi_loot(loottable, prand) return items end @@ -163,14 +163,14 @@ end ------------------------------------------------------------------------------- function settlements.initialize_furnace(pos) -- find chests within radius - local furnacepos = minetest.find_node_near(pos, + local furnacepos = minetest.find_node_near(pos, 7, --radius {"mcl_furnaces:furnace"}) -- initialize furnacepos (mts furnacepos don't have meta) - if furnacepos + if furnacepos then local meta = minetest.get_meta(furnacepos) - if meta:get_string("infotext") ~= "furnace" + if meta:get_string("infotext") ~= "furnace" then minetest.registered_nodes["mcl_furnaces:furnace"].on_construct(furnacepos) end @@ -181,14 +181,14 @@ end ------------------------------------------------------------------------------- function settlements.initialize_anvil(pos) -- find chests within radius - local anvilpos = minetest.find_node_near(pos, + local anvilpos = minetest.find_node_near(pos, 7, --radius {"mcl_anvils:anvil"}) -- initialize anvilpos (mts anvilpos don't have meta) - if anvilpos + if anvilpos then local meta = minetest.get_meta(anvilpos) - if meta:get_string("infotext") ~= "anvil" + if meta:get_string("infotext") ~= "anvil" then minetest.registered_nodes["mcl_anvils:anvil"].on_construct(anvilpos) end diff --git a/mods/MAPGEN/tsm_railcorridors/init.lua b/mods/MAPGEN/tsm_railcorridors/init.lua index 893f3d739..2414cc962 100644 --- a/mods/MAPGEN/tsm_railcorridors/init.lua +++ b/mods/MAPGEN/tsm_railcorridors/init.lua @@ -823,7 +823,7 @@ local function create_corridor_line(waypoint, axis, sign, length, wood, post, da local s = sign local ud = false -- Up or down local udn = false -- Up or down is next - local udp = false -- Up or down was previous + local udp -- Up or down was previous local up = false -- true if going up local upp = false -- true if was going up previously for i=1,length do @@ -911,7 +911,7 @@ local function create_corridor_line(waypoint, axis, sign, length, wood, post, da a="z" elseif a=="z" then a="x" - end; + end; s = pr:next(1, 2) == 1 end end diff --git a/mods/MISC/findbiome/init.lua b/mods/MISC/findbiome/init.lua index ce7fd9799..5f55da493 100644 --- a/mods/MISC/findbiome/init.lua +++ b/mods/MISC/findbiome/init.lua @@ -119,7 +119,7 @@ local function find_biome(pos, biomes) local edge_dist = 0 local dir_step = 0 local dir_ind = 1 - local success = false + local success local spawn_pos local biome_ids @@ -166,7 +166,7 @@ local function find_biome(pos, biomes) spawn_pos = {x = spos.x, y = spos.y, z = spos.z} end if spawn_pos then - local adjusted_pos, outside = adjust_pos_to_biome_limits(spawn_pos, biome_id) + local _,outside = adjust_pos_to_biome_limits(spawn_pos, biome_id) if is_in_world(spawn_pos) and not outside then return true end diff --git a/mods/MISC/mcl_commands/init.lua b/mods/MISC/mcl_commands/init.lua index 7a9fe4868..a287c2926 100644 --- a/mods/MISC/mcl_commands/init.lua +++ b/mods/MISC/mcl_commands/init.lua @@ -1,7 +1,3 @@ -local S = minetest.get_translator("mcl_commands") - -local mod_death_messages = minetest.get_modpath("mcl_death_messages") - local modpath = minetest.get_modpath(minetest.get_current_modname()) dofile(modpath.."/kill.lua") diff --git a/mods/MISC/mcl_commands/setblock.lua b/mods/MISC/mcl_commands/setblock.lua index 30d68b74f..dc834e1e8 100644 --- a/mods/MISC/mcl_commands/setblock.lua +++ b/mods/MISC/mcl_commands/setblock.lua @@ -6,7 +6,7 @@ minetest.register_chatcommand("setblock", { privs = {give=true, interact=true}, func = function(name, param) local p = {} - local nodestring = nil + local nodestring p.x, p.y, p.z, nodestring = param:match("^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+) +(.+)$") p.x, p.y, p.z = tonumber(p.x), tonumber(p.y), tonumber(p.z) if p.x and p.y and p.z and nodestring then diff --git a/mods/MISC/mcl_commands/sound.lua b/mods/MISC/mcl_commands/sound.lua index 934abb80e..06225271d 100644 --- a/mods/MISC/mcl_commands/sound.lua +++ b/mods/MISC/mcl_commands/sound.lua @@ -4,39 +4,34 @@ minetest.register_chatcommand("playsound",{ params = S(" "), --TODO:add source description = S("Play a sound. Arguments: : name of the sound. : Target."), privs = {server = true}, - func = function(name, params) + func = function(name, rawparams) local P = {} local i = 0 - for str in string.gmatch(params, "([^ ]+)") do + for str in string.gmatch(rawparams, "([^ ]+)") do i = i + 1 P[i] = str end - local params = {} if P[1] == tostring(P[1]) then params.name = P[1] else return false, S("Sound name is invalid!") --TODO: add mc chat message end - if P[2] == tostring(P[2]) and minetest.player_exists(P[2]) then params.target = P[2] else return false, S("Target is invalid!!") end - -- if P[3] then -- params.pos = nil --TODO:position -- else -- params.pos = nil -- end - -- if P[4] == tonumber(P[4]) then -- params.gain = P[4] -- else -- params.gain = 1.0 -- end - -- if P[5] == tonumber(P[5]) then -- params.pitch = P[5] -- else diff --git a/mods/MISC/mcl_temp_helper_recipes/init.lua b/mods/MISC/mcl_temp_helper_recipes/init.lua index d1262cb2c..ff9f541f3 100644 --- a/mods/MISC/mcl_temp_helper_recipes/init.lua +++ b/mods/MISC/mcl_temp_helper_recipes/init.lua @@ -27,7 +27,12 @@ minetest.register_craft({ minetest.register_craft({ type = "shapeless", output = "mcl_ocean:prismarine_crystals", - recipe = { "mcl_ocean:prismarine_shard", "mcl_ocean:prismarine_shard", "mcl_ocean:prismarine_shard", "mcl_core:gold_ingot" }, + recipe = { + "mcl_ocean:prismarine_shard", + "mcl_ocean:prismarine_shard", + "mcl_ocean:prismarine_shard", + "mcl_core:gold_ingot", + }, }) minetest.register_craft({ diff --git a/mods/PLAYER/mcl_death_drop/init.lua b/mods/PLAYER/mcl_death_drop/init.lua index 7c54334a9..90a2b0fbd 100644 --- a/mods/PLAYER/mcl_death_drop/init.lua +++ b/mods/PLAYER/mcl_death_drop/init.lua @@ -20,7 +20,7 @@ minetest.register_on_dieplayer(function(player) local playerinv = player:get_inventory() local pos = player:get_pos() -- No item drop if in deep void - local void, void_deadly = mcl_worlds.is_in_void(pos) + local _, void_deadly = mcl_worlds.is_in_void(pos) for l=1,#mcl_death_drop.registered_dropped_lists do local inv = mcl_death_drop.registered_dropped_lists[l].inv diff --git a/mods/PLAYER/mcl_hunger/api.lua b/mods/PLAYER/mcl_hunger/api.lua index 55153b9bf..4fea9b04e 100644 --- a/mods/PLAYER/mcl_hunger/api.lua +++ b/mods/PLAYER/mcl_hunger/api.lua @@ -86,7 +86,8 @@ if mcl_hunger.active then function mcl_hunger.saturate(playername, increase, update_hudbar) local player = minetest.get_player_by_name(playername) - local ok = mcl_hunger.set_saturation(player, math.min(mcl_hunger.get_saturation(player) + increase, mcl_hunger.get_hunger(player))) + local ok = mcl_hunger.set_saturation(player, + math.min(mcl_hunger.get_saturation(player) + increase, mcl_hunger.get_hunger(player))) if update_hudbar ~= false then mcl_hunger.update_saturation_hud(player, mcl_hunger.get_saturation(player), mcl_hunger.get_hunger(player)) end @@ -105,7 +106,7 @@ if mcl_hunger.active then -- otherwise the following poison/exhaust fields are ignored food[name].poison = poison -- poison damage per tick for poisonous food food[name].exhaust = exhaust -- exhaustion per tick for poisonous food - food[name].poisonchance = poisonchance -- chance percentage that this item poisons the player (default: 100% if poisoning is enabled) + food[name].poisonchance = poisonchance -- chance percentage that this item poisons the player (default: 100%) food[name].sound = sound -- special sound that is played when eating end diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index 393bdc9a9..30ad10ac2 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -2,7 +2,6 @@ local S = minetest.get_translator("mcl_hunger") local mod_death_messages = minetest.get_modpath("mcl_death_messages") -- wrapper for minetest.item_eat (this way we make sure other mods can't break this one) -local org_eat = minetest.do_item_eat minetest.do_item_eat = function(hp_change, replace_with_item, itemstack, user, pointed_thing) if not user or user:is_player() == false then @@ -38,7 +37,8 @@ minetest.do_item_eat = function(hp_change, replace_with_item, itemstack, user, p -- FIXME: In singleplayer, there's a cheat to circumvent this, simply by pausing the game between eats. -- This is because os.time() obviously does not care about the pause. A fix needs a different timer mechanism. if no_eat_delay or (mcl_hunger.last_eat[name] < 0) or (os.difftime(os.time(), mcl_hunger.last_eat[name]) >= 2) then - local can_eat_when_full = creative or (mcl_hunger.active == false) or minetest.get_item_group(itemstack:get_name(), "can_eat_when_full") == 1 + local can_eat_when_full = creative or (mcl_hunger.active == false) + or minetest.get_item_group(itemstack:get_name(), "can_eat_when_full") == 1 -- Don't allow eating when player has full hunger bar (some exceptional items apply) if can_eat_when_full or (mcl_hunger.get_hunger(user) < 20) then itemstack = mcl_hunger.eat(hp_change, replace_with_item, itemstack, user, pointed_thing) @@ -67,7 +67,8 @@ function mcl_hunger.eat(hp_change, replace_with_item, itemstack, user, pointed_t def.saturation = hp_change def.replace = replace_with_item end - local func = mcl_hunger.item_eat(def.saturation, def.replace, def.poisontime, def.poison, def.exhaust, def.poisonchance, def.sound) + local func = mcl_hunger.item_eat(def.saturation, def.replace, def.poisontime, + def.poison, def.exhaust, def.poisonchance, def.sound) return func(itemstack, user, pointed_thing) end @@ -90,7 +91,6 @@ local function poisonp(tick, time, time_left, damage, exhaustion, name) if not player then return end - local name = player:get_player_name() -- Abort if food poisonings have been stopped if mcl_hunger.poison_hunger[name] == 0 then return @@ -131,7 +131,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso itemstack:take_item() end local name = user:get_player_name() - local hp = user:get_hp() + --local hp = user:get_hp() local pos = user:get_pos() -- player height diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index b640dfdc9..c65206599 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -65,9 +65,7 @@ end -- Count number of poisonings a player has at once mcl_hunger.poison_hunger = {} -- food poisoning, increasing hunger --- HUD item ids -local hunger_hud = {} - +-- HUD local function init_hud(player) hb.init_hudbar(player, "hunger", mcl_hunger.get_hunger(player)) if mcl_hunger.debug then diff --git a/mods/PLAYER/mcl_meshhand/init.lua b/mods/PLAYER/mcl_meshhand/init.lua index cdd5da946..80bf36b7d 100644 --- a/mods/PLAYER/mcl_meshhand/init.lua +++ b/mods/PLAYER/mcl_meshhand/init.lua @@ -63,7 +63,6 @@ end if has_mcl_skins == true then --change the player's hand to their skin mcl_skins.register_on_set_skin(function(player, skin) - local name = player:get_player_name() local meta = mcl_skins.meta[skin] if meta.gender == "female" then player:get_inventory():set_stack("hand", 1, "mcl_meshhand:"..skin.."_female") diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 210e2d19f..9df852502 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -9,7 +9,7 @@ local animation_blend = 0 local function get_mouse_button(player) local controls = player:get_player_control() local get_wielded_item_name = player:get_wielded_item():get_name() - if controls.RMB and not string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") or controls.LMB then + if controls.RMB and not string.find(get_wielded_item_name, "mcl_bows:bow") or controls.LMB then return true else return false @@ -110,7 +110,7 @@ function mcl_player.get_player_formspec_model(player, x, y, w, h, fsname) local name = player:get_player_name() local model = player_model[name] local anim = models[model].animations[player_anim[name]] - return "model[" .. x .. "," .. y .. ";" .. w .. "," .. h .. ";" .. fsname .. ";" .. model .. ";" .. table.concat(player_textures[name], ",") .. ";0," .. 180 .. ";false;false;" .. anim.x .. "," .. anim.y .. "]" + return "model["..x..","..y..";"..w..","..h..";"..fsname..";"..model..";"..table.concat(player_textures[name], ",")..";0,".. 180 ..";false;false;"..anim.x..","..anim.y.."]" end function mcl_player.player_set_animation(player, anim_name, speed) @@ -179,7 +179,10 @@ minetest.register_globalstep(function(dtime) -- Apply animations based on what the player is doing if player:get_hp() == 0 then player_set_animation(player, "die") - elseif walking and velocity.x > 0.35 or walking and velocity.x < -0.35 or walking and velocity.z > 0.35 or walking and velocity.z < -0.35 then + elseif walking and velocity.x > 0.35 + or walking and velocity.x < -0.35 + or walking and velocity.z > 0.35 + or walking and velocity.z < -0.35 then if player_sneak[name] ~= controls.sneak then player_anim[name] = nil player_sneak[name] = controls.sneak diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 6dbf49f7f..43f636498 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -1,5 +1,9 @@ local S = minetest.get_translator("mcl_playerplus") +mcl_playerplus = { + elytra = {}, +} + local get_connected_players = minetest.get_connected_players local dir_to_yaw = minetest.dir_to_yaw local get_item_group = minetest.get_item_group @@ -19,13 +23,13 @@ local math = math -- Internal player state local mcl_playerplus_internal = {} -local def = {} local time = 0 +local look_pitch = 0 local player_collision = function(player) local pos = player:get_pos() - local vel = player:get_velocity() + --local vel = player:get_velocity() local x = 0 local z = 0 local width = .75 @@ -54,18 +58,8 @@ local function degrees(rad) return rad * 180.0 / math.pi end -local pi = math.pi -local atann = math.atan -local atan = function(x) - if not x or x ~= x then - return 0 - else - return atann(x) - end -end - local dir_to_pitch = function(dir) - local dir2 = vector.normalize(dir) + --local dir2 = vector.normalize(dir) local xz = math.abs(dir.x) + math.abs(dir.z) return -math.atan2(-dir.y, xz) end @@ -117,7 +111,7 @@ function limit_vel_yaw(player_vel_yaw, yaw) return player_vel_yaw end -local pitch, name, node_stand, node_stand_below, node_head, node_feet, pos +local node_stand, node_stand_below, node_head, node_feet minetest.register_on_punchplayer(function(player, hitter, damage) @@ -156,13 +150,6 @@ minetest.register_globalstep(function(dtime) for _,player in pairs(get_connected_players()) do - c_x, c_y = unpack(player_collision(player)) - - --if player:get_velocity().x + player:get_velocity().y < .5 and c_x + c_y > 0 then - --minetest.chat_send_player(player:get_player_name(), "pushed at " .. c_x + c_y .. " parsecs.") - --player:add_velocity({x=c_x, y=0, z=c_y}) - --end - --[[ _ _ _ __ _ _ __ (_)_ __ ___ __ _| |_(_) ___ _ __ ___ @@ -172,14 +159,22 @@ minetest.register_globalstep(function(dtime) ]]-- - local controls = player:get_player_control() + local control = player:get_player_control() local name = player:get_player_name() - local meta = player:get_meta() + --local meta = player:get_meta() local parent = player:get_attach() local wielded = player:get_wielded_item() local player_velocity = player:get_velocity() or player:get_player_velocity() - -- controls head bone + local c_x, c_y = unpack(player_collision(player)) + + if player_velocity.x + player_velocity.y < .5 and c_x + c_y > 0 then + local add_velocity = player.add_player_velocity or player.add_velocity + add_velocity(player, {x = c_x, y = 0, z = c_y}) + player_velocity = player:get_velocity() or player:get_player_velocity() + end + + -- control head bone local pitch = - degrees(player:get_look_vertical()) local yaw = degrees(player:get_look_horizontal()) @@ -190,12 +185,49 @@ minetest.register_globalstep(function(dtime) player_vel_yaw = limit_vel_yaw(player_vel_yaw, yaw) player_vel_yaws[name] = player_vel_yaw + local fly_pos = player:get_pos() + local fly_node = minetest.get_node({x = fly_pos.x, y = fly_pos.y - 0.5, z = fly_pos.z}).name + local elytra = mcl_playerplus.elytra[player] + + elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra" + and not player:get_attach() + and (elytra.active or control.jump and player_velocity.y < -6) + and (fly_node == "air" or fly_node == "ignore") + + if elytra.active then + mcl_player.player_set_animation(player, "fly") + if player_velocity.y < -1.5 then + player:add_velocity({x=0, y=0.17, z=0}) + end + if math.abs(player_velocity.x) + math.abs(player_velocity.z) < 20 then + local dir = minetest.yaw_to_dir(player:get_look_horizontal()) + if degrees(player:get_look_vertical()) * -.01 < .1 then + look_pitch = degrees(player:get_look_vertical()) * -.01 + else + look_pitch = .1 + end + player:add_velocity({x=dir.x, y=look_pitch, z=dir.z}) + end + playerphysics.add_physics_factor(player, "gravity", "mcl_playerplus:elytra", 0.1) + + if elytra.rocketing > 0 then + elytra.rocketing = elytra.rocketing - dtime + if vector.length(player_velocity) < 40 then + local add_velocity = player.add_velocity or player.add_player_velocity + add_velocity(player, vector.multiply(player:get_look_dir(), 4)) + end + end + else + elytra.rocketing = 0 + playerphysics.remove_physics_factor(player, "gravity", "mcl_playerplus:elytra") + end + -- controls right and left arms pitch when shooting a bow - if string.find(wielded:get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then + if string.find(wielded:get_name(), "mcl_bows:bow") and control.RMB and not control.LMB and not control.up and not control.down and not control.left and not control.right then player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35)) -- when punching - elseif controls.LMB and not parent then + elseif control.LMB and not parent then player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch,0,0)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0)) -- when holding an item. @@ -208,21 +240,28 @@ minetest.register_globalstep(function(dtime) player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(0,0,0)) end - if parent then + if elytra.active then + -- set head pitch and yaw when flying + player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0)) + -- sets eye height, and nametag color accordingly + player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 0.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) + -- control body bone when flying + player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(degrees(dir_to_pitch(player_velocity)) - 90,-player_vel_yaw + yaw + 180,0)) + elseif parent then local parent_yaw = degrees(parent:get_yaw()) player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) - player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch, -limit_vel_yaw(yaw, parent_yaw) + parent_yaw, 0)) + player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch, -limit_vel_yaw(yaw, parent_yaw) + parent_yaw, 0)) player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0)) - elseif controls.sneak then + elseif control.sneak then -- controls head pitch when sneaking - player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+36,0,0)) + player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, player_vel_yaw - yaw)) -- sets eye height, and nametag color accordingly player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }}) -- sneaking body conrols - player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0,0,0)) + player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0, -player_vel_yaw + yaw, 0)) elseif get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 and is_sprinting(name) == true then -- set head pitch and yaw when swimming - player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0)) + player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch-degrees(dir_to_pitch(player_velocity)),player_vel_yaw - yaw,0)) -- sets eye height, and nametag color accordingly player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,0.8,0.312}, eye_height = 0.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) -- control body bone when swimming @@ -231,7 +270,7 @@ minetest.register_globalstep(function(dtime) -- sets eye height, and nametag color accordingly player:set_properties({collisionbox = {-0.312,0,-0.312,0.312,1.8,0.312}, eye_height = 1.5, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}) - player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, 0)) + player:set_bone_position("Head_Control", vector.new(0,6.3,0), vector.new(pitch, player_vel_yaw - yaw, 0)) player:set_bone_position("Body_Control", vector.new(0,6.3,0), vector.new(0, -player_vel_yaw + yaw, 0)) end @@ -242,9 +281,9 @@ minetest.register_globalstep(function(dtime) mcl_playerplus_internal[name].jump_cooldown = mcl_playerplus_internal[name].jump_cooldown - dtime end - if controls.jump and mcl_playerplus_internal[name].jump_cooldown <= 0 then + if control.jump and mcl_playerplus_internal[name].jump_cooldown <= 0 then - pos = player:get_pos() + --pos = player:get_pos() node_stand = mcl_playerinfo[name].node_stand node_stand_below = mcl_playerinfo[name].node_stand_below @@ -316,9 +355,6 @@ minetest.register_globalstep(function(dtime) return end - -- set defaults - def.speed = 1 - -- Standing on soul sand? If so, walk slower (unless player wears Soul Speed boots) if node_stand == "mcl_nether:soul_sand" then -- TODO: Tweak walk speed @@ -473,6 +509,7 @@ minetest.register_on_joinplayer(function(player) swimDistance = 0, jump_cooldown = -1, -- Cooldown timer for jumping, we need this to prevent the jump exhaustion to increase rapidly } + mcl_playerplus.elytra[player] = {active = false, rocketing = 0} end) -- clear when player leaves @@ -480,4 +517,5 @@ minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() mcl_playerplus_internal[name] = nil + mcl_playerplus.elytra[player] = nil end) diff --git a/mods/PLAYER/mcl_skins/init.lua b/mods/PLAYER/mcl_skins/init.lua index 5956aab7c..0b508adc6 100644 --- a/mods/PLAYER/mcl_skins/init.lua +++ b/mods/PLAYER/mcl_skins/init.lua @@ -198,7 +198,6 @@ minetest.register_chatcommand("setskin", { end end - local skin local ok = mcl_skins.set_player_skin(player, skin_id) if not ok then return false, S("Invalid skin number! Valid numbers: 0 to @1", mcl_skins.skin_count) @@ -240,7 +239,7 @@ end) mcl_skins.show_formspec = function(playername) local formspec = "size[7,8.5]" - formspec = formspec .. "label[2,2;" .. minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Select player skin:"))) .. "]" + formspec = formspec .. "label[2,2;" .. minetest.formspec_escape(minetest.colorize("#383838", S("Select player skin:"))) .. "]" .. "textlist[0,2.5;6.8,6;skins_set;" local meta @@ -268,7 +267,7 @@ mcl_skins.show_formspec = function(playername) if meta then if meta.name and meta.name ~= "" then - formspec = formspec .. "label[2,0.5;" .. minetest.formspec_escape(minetest.colorize(mcl_colors.DARK_GRAY, S("Name: @1", meta.name))) .. "]" + formspec = formspec .. "label[2,0.5;" .. minetest.formspec_escape(minetest.colorize("#383838", S("Name: @1", meta.name))) .. "]" end end diff --git a/mods/PLAYER/mcl_skins/intllib.lua b/mods/PLAYER/mcl_skins/intllib.lua deleted file mode 100644 index 6669d7202..000000000 --- a/mods/PLAYER/mcl_skins/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index fe88cf3de..441db28b7 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -500,10 +500,8 @@ function mcl_spawn.shadow_worker() if success then local wsp_node = minetest.get_node(wsp) - if wsp_node and wsp_node.name == "ignore" then - -- special case - respawn area unloaded from memory - it's okay, skip for now - - elseif ((not good_for_respawn(wsp)) or ((no_trees_area_counter >= 0) and not can_find_tree(wsp))) then + if not (wsp_node and wsp_node.name == "ignore") + and ((not good_for_respawn(wsp)) or ((no_trees_area_counter >= 0) and not can_find_tree(wsp))) then success = false minetest.log("action", "[mcl_spawn] World spawn position isn't safe anymore: "..minetest.pos_to_string(wsp)) mcl_spawn.search() diff --git a/mods/PLAYER/mcl_sprint/init.lua b/mods/PLAYER/mcl_sprint/init.lua index 9dc678000..12d0394e5 100644 --- a/mods/PLAYER/mcl_sprint/init.lua +++ b/mods/PLAYER/mcl_sprint/init.lua @@ -53,7 +53,10 @@ local function setSprinting(playerName, sprinting) --Sets the state of a player local controls = player:get_player_control() if players[playerName] then players[playerName].sprinting = sprinting - if sprinting == true or controls.RMB and string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and player:get_wielded_item():get_name() ~= "mcl_bows:bow" then + if sprinting == true + or controls.RMB + and string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") + and player:get_wielded_item():get_name() ~= "mcl_bows:bow" then if sprinting == true then players[playerName].fov = math.min(players[playerName].fov + 0.05, 1.2) players[playerName].fade_time = .15 @@ -65,7 +68,10 @@ local function setSprinting(playerName, sprinting) --Sets the state of a player if sprinting == true then playerphysics.add_physics_factor(player, "speed", "mcl_sprint:sprint", mcl_sprint.SPEED) end - elseif sprinting == false and player:get_wielded_item():get_name() ~= "mcl_bows:bow_0" and player:get_wielded_item():get_name() ~= "mcl_bows:bow_1" and player:get_wielded_item():get_name() ~= "mcl_bows:bow_2" then + elseif sprinting == false + and player:get_wielded_item():get_name() ~= "mcl_bows:bow_0" + and player:get_wielded_item():get_name() ~= "mcl_bows:bow_1" + and player:get_wielded_item():get_name() ~= "mcl_bows:bow_2" then players[playerName].fov = math.max(players[playerName].fov - 0.05, 1.0) player:set_fov(players[playerName].fov, true, 0.15) if sprinting == false then @@ -186,7 +192,8 @@ minetest.register_globalstep(function(dtime) if players[playerName]["shouldSprint"] == true then --Stopped local sprinting -- Prevent sprinting if hungry or sleeping - if (mcl_hunger.active and mcl_hunger.get_hunger(player) <= 6) or (player:get_meta():get_string("mcl_beds:sleeping") == "true") then + if (mcl_hunger.active and mcl_hunger.get_hunger(player) <= 6) + or (player:get_meta():get_string("mcl_beds:sleeping") == "true") then sprinting = false cancelClientSprinting(playerName) else diff --git a/mods/PLAYER/wieldview/init.lua b/mods/PLAYER/wieldview/init.lua index 7a349f2f3..91b2cd721 100644 --- a/mods/PLAYER/wieldview/init.lua +++ b/mods/PLAYER/wieldview/init.lua @@ -1,4 +1,3 @@ -local time = 0 local update_time = tonumber(minetest.settings:get("wieldview_update_time")) if not update_time then update_time = 2 @@ -69,14 +68,14 @@ end minetest.register_on_joinplayer(function(player) local name = player:get_player_name() wieldview.wielded_item[name] = "" - minetest.after(0, function(player) + minetest.after(0, function(target) -- if the player left :is_player() will return nil - if not player:is_player() then + if not target:is_player() then return end - wieldview:update_wielded_item(player) - local itementity = minetest.add_entity(player:get_pos(), "wieldview:wieldnode") - itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45)) + wieldview:update_wielded_item(target) + local itementity = minetest.add_entity(target:get_pos(), "wieldview:wieldnode") + itementity:set_attach(target, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45)) itementity:get_luaentity().wielder = name end, player) end) diff --git a/settingtypes.txt b/settingtypes.txt index bfda9b3ba..c5968a4c0 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -98,7 +98,7 @@ animated_chests (Animated chests) bool true 3d_player_preview (3D Player preview) bool true # The maximum number of boss bars to simultaniously display on the screen -max_bossbars (Maximum Boss bars) int 4 +max_bossbars (Maximum Boss bars) int 5 [Experimental] # Whether ice is translucent. If disabled, ice is fully opaque. diff --git a/tools/create_luacheck.py b/tools/create_luacheck.py new file mode 100644 index 000000000..e69de29bb