diff --git a/mods/3d_armor/3d_armor/README.md b/mods/3d_armor/3d_armor/README.md new file mode 100644 index 00000000..5e9e3b9f --- /dev/null +++ b/mods/3d_armor/3d_armor/README.md @@ -0,0 +1,482 @@ +# [mod] Visible Player Armor [3d_armor] + +| | | | | +|--|--|--|--| +|-[Overview](#overview) |||-[API](#api)| +|-[Armor Configuration](#armor-configuration) |||- - [3d_Armor Item Storage](#3d_armor-item-storage) +|- - [disable_specific_materials](#to-disable-individual-armor-materials) |||- - [Armor Registration](#armor-registration) +|- - [armor_init_delay](#initialization-glitches-when-a-player-first-joins) |||- - [Registering Armor Groups](#registering-armor-groups) +|- - [armor_init_times](#number-of-initialization-attempts) |||- - [Groups used by 3d_Armor](#groups-used-by-3d_armor) +|- - [armor_bones_delay](#armor-not-in-bones-due-to-server-lag) |||- - - [Elements](#elements) +|- - [armor_update_time](#how-often-player-armor-items-are-updated) |||- - - [Attributes](#attributes) +|- - [armor_drop](#drop-armor-when-a-player-dies) |||- - - [Physics](#physics) +|- - [armor_destroy](#destroy-armor-when-a-player-dies) |||- - - [Durability](#durability) +|- - [armor_level_multiplier](#armor-level-multiplyer) |||- - [Armour Functions](#armour-functions) +|- - [armor_heal_multiplier](#armor-healing-multiplyer) |||- - - [armor:set_player_armor](#armor-set_player_armor) +|- - [armor_water_protect](#enable-water-protection) |||- - - [armor:punch](#armor-punch) +|- - [armor_fire_protect](#enable-fire-protection) |||- - - [armor:damage](#armor-damage) +|- - [armor_punch_damage](#enable-punch-damage-effects) |||- - - [armor:remove_all](#armor-remove_all) +|- - [armor_migrate_old_inventory](#migration-of-old-armor-inventories) |||- - - [armor:equip](#armor-equip) +|- - [wieldview_update_time](#how-often-player-wield-items-are-updated) |||- - - [armor:unequip](#armor-unequip) +| - [Credits](#credits) |||- - - [armor:update_skin](#armor-update_skin) +| |||- - [Callbacks](#Callbacks) +| |||- - - [Item callbacks](#item-callbacks) +| |||- - - [Global callbacks](#global-callbacks) + +# Overview + +**Depends:** default + +**Recommends:** sfinv, unified_inventory or smart_inventory (use only one to avoid conflicts) + +**Supports:** player_monoids, armor_monoid and POVA + +Adds craftable armor that is visible to other players. Each armor item worn contributes to +a player's armor group level making them less vulnerable to weapons. + +Armor takes damage when a player is hurt but also offers a percentage chance of healing. +Overall level is boosted by 10% when wearing a full matching set. + +# Armor Configuration + +Override the following default settings by adding them to your ***minetest.conf*** file. + +### To disable individual armor materials + **set the below to false** + + armor_material_wood = true + armor_material_cactus = true + armor_material_steel = true + armor_material_bronze = true + armor_material_diamond = true + armor_material_gold = true + armor_material_mithril = true + armor_material_crystal = true + +### Initialization glitches when a player first joins + **Increase to prevent glitches** + + armor_init_delay = 2 + +### Number of initialization attempts + **Increase to prevent glitches - Use in conjunction with armor_init_delay if initialization problems persist.** + + armor_init_times = 10 + +### Armor not in bones due to server lag + **Increase to help resolve** + + armor_bones_delay = 1 + +### How often player armor items are updated +**Number represents how often per second update is performed, higher value means less performance hit for servers but armor items maybe delayed in updating when switching.Fractional seconds also supported eg 0.1** + + armor_update_time = 1 + +### Drop armor when a player dies + **Uses bones mod if present, otherwise items are dropped around the player when false.** + + armor_drop = true + +### Destroy armor when a player dies + **overrides armor_drop.** + + armor_destroy = false + +### Armor level multiplyer + **Increase to make armor more effective and decrease to make armor less effective** + **eg: level_multiplier = 0.5 will reduce armor level by half.** + + armor_level_multiplier = 1 + +### Armor healing multiplyer + **Increase to make armor healing more effective and decrease to make healing less effective** + **eg: armor_heal_multiplier = 0 will disable healing altogether.** + + armor_heal_multiplier = 1 + +### Enable water protection + **periodically restores breath when activated** + + armor_water_protect = true + +### Enable fire protection +**defaults to true if using ethereal mod** + + armor_fire_protect = false + +### Fire protection enabled, disable torch fire damage +**when fire protection is enabled allows you to disable fire damage from torches** +**defaults to true if using ethereal mod** + + armor_fire_protect_torch = false + +### Enable punch damage effects + + armor_punch_damage = true + +### Migration of old armor inventories + + armor_migrate_old_inventory = true + +### How often player wield items are updated +**Number represents how often per second update is performed, higher value means less performance hit for servers but wield items maybe delayed in updating when switching. Fractional seconds also supported eg 0.1** +***Note this is MT engine functionality but included for completness*** + + wieldview_update_time = 1 + +# API + +## 3d_Armor item storage +3d_Armor stores each armor piece a player currently has equiped in a ***detached*** inventory. The easiest way to access this inventory if needed is using this line of code + + local _, armor_inv = armor:get_valid_player(player, "3d_armor") + +**Example** + + armor:register_on_equip(function(player, index, stack) + local _, armor_inv = armor:get_valid_player(player, "3d_armor") + for i = 1, 6 do + local stack = armor_inv:get_stack("armor", i) + if stack:get_name() == "3d_armor:chestplate_gold" then + minetest.chat_send_player(player:get_player_name(),"Got to love the Bling!!!") + end + end + end) + +## Armor Registration + + armor:register_armor(name, def) + +Wrapper function for `minetest.register_tool`, which enables the easy registration of new armor items. While registering armor as a tool item is still supported, this may be deprecated in future so all armor items should be registered using *armor:register_armor(name,def)*. + +### Additional fields supported by 3d_armor + + texture = + preview = + armor_groups = + damage_groups =
+ reciprocate_damage = + on_equip = + on_unequip = + on_destroy = + on_damage = + on_punched = + +***Reciprocal tool*** damage will apply damage back onto the attacking tool/weapon, however this will only be done by the first armor inventory item with `reciprocate_damage = true`, damage does not stack. + +**Example Simple:** + + armor:register_armor("mod_name:chestplate_leather", { + description = "Leather Chestplate", + inventory_image = "mod_name_inv_chestplate_leather.png", + texture = "mod_name_leather_chestplate.png", + preview = "mod_name_leather_chestplate_preview.png", + groups = {armor_torso=1, armor_heal=0, armor_use=2000, flammable=1}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1} + }) +*See ***armor.lua*** under **3d_armor>>3d_armor** for further examples* + +**Extended functionality** +The values for ***texture*** and ***preview*** do not need to be included when registering armor if they follow the naming convention in the textures mod folder of: +***texture:*** *mod_name_leather_chestplate.png* +***preview:*** *mod_name_leather_chestplate_preview.png* + +## Registering Armor Groups +3d armor has a built in armor group which is ***fleshy*** all players base vulnerability to being fleshy is ***100***. + 3d armour allows for the easy registration/addition of new armor groups:: + + armor:register_armor_group(group, base) + +***group:*** Is the name of the new armor group +***base*** Is the starting vulnerability that all players have to that new group. This dosent need to be 100. + +**Example** + + armor:register_armor_group("radiation", 100) + +New armor group is registered called *radiation* and all players start off with a base vulnerability of *100* to radiation. + +**Example** *Showing armor reg, new group usage and custom function* + + armor:register_armor("mod_name:speed_boots", { + description = "Speed Boots", + inventory_image = "mod_name_speed_boots_inv.png", + texture = "mod_name_speed_boots.png", + preview = "mod_name_speed_boots_preview.png", + groups = {armor_feet=1, armor_use=500, physics_speed=1.2, flammable=1}, + armor_groups = {fleshy=10, radiation=10}, + damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1}, + reciprocate_damage = true, + on_destroy = function(player, index, stack) + local pos = player:get_pos() + if pos then + minetest.sound_play({ + name = "mod_name_break_sound", + pos = pos, + gain = 0.5, + }) + end + end, + }) + +### Tools/weapons and new armor groups +The above allows armor to block/prevent new damage types but you also need to assign the new damage group to a tool/weapon or even a node (see technic mod) to make wearing the armor item meaningful. Simply add the ***armor_groups*** name to the tool items ***damage_groups***. + +**Example** + + minetest.register_tool("mod_name:glowing_sword", { + description = "Glowing Sword", + inventory_image = "mod_name_tool_glowingsword.png", + tool_capabilities = {full_punch_interval = 1.2,max_drop_level=0, + groupcaps={ + cracky = {times={[3]=1.60}, uses=10, maxlevel=1},}, + damage_groups = {fleshy=10,radiation=20}, + }, + sound = {breaks = "default_tool_breaks"}, + groups = {pickaxe = 1, flammable = 2} + }) + +## Groups used by 3d_Armor +3d_armor has many default groups already registered, these are categorized under 4 main headings + - **Elements:** armor_head, armor_torso, armor_legs, armor_feet + - **Attributes:** armor_heal, armor_fire, armor_water + - **Physics:** physics_jump, physics_speed, physics_gravity + - **Durability:** armor_use, flammable + +***Note: for calculation purposes "Attributes" and "Physics" values stack*** + +### Elements +Additional armor elements can be added by dependant mods, for example shields adds the group armor_shield which has by default a limit that only 1 shield can be worn at a time. + +Adding Elements is more complex but the below code can be used to add new elements; + + if minetest.global_exists("armor") and armor.elements then + table.insert(armor.elements, "hands") + local mult = armor.config.level_multiplier or 1 + armor.config.level_multiplier = mult * 0.5 + end +**1st line** not strictly needed but checks that the global table "armor" and subtable "elements" exists +**2nd line** adds a new value to the armor.elements table called "hands" +**3rd line** in this case will be set to one ***note: need more detail here*** +**4th line** simply sets the multiplier, by setting 0.5 smaller armor becomes less effective and larger more effective. good values are between 0.1 and 1 in increments of 0.1. + +See ***init.lua*** under **3d_armor>>shields** for a further example + +The new armor item can now be registered using the new element +**Example** + + armor:register_armor("mod_name:gloves_wood", { + description = "Wood Gauntlets", + inventory_image = "mod_name_inv_gloves_wood.png", + texture = "mod_name_gloves_wood.png", + preview = "mod_name_gloves_wood_preview.png", + groups = {armor_hands=1, armor_heal=0, armor_use=2000, flammable=1}, + armor_groups = {fleshy=5}, + damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1}, + }) + +### Attributes +Three attributes are avaliable in 3d_armor these are armor_heal, armor_fire and armor_water. Although possible to add additional attributes they would do nothing as code needs to be provide to specifiy the behaviour this could be done in a dependant mod + +#### Armor_heal +This isn't how much the armor will heal but relates to the chance the armor will completely block the damage. For each point of ***armor_heal*** there is a 1% chance that damage will be completely blocked, this value will stack between all armor pieces + +**Example** +The below Diamond chestplate has a 12% chance to completely block all damage (armor_heal=12), however so do boots, helmet and trousers so if the player was wearing all 4 pieces they would have a 48% chance of blocking all damage each attack. + + armor:register_armor("3d_armor:chestplate_diamond", { + description = S("Diamond Chestplate"), + inventory_image = "3d_armor_inv_chestplate_diamond.png", + groups = {armor_torso=1, armor_heal=12, armor_use=200}, + armor_groups = {fleshy=20}, + damage_groups = {cracky=2, snappy=1, choppy=1, level=3}, + }) + +#### Armor_fire +***"Armor_fire"*** provides 5 levels of fire protection + - level 1 protects against torches + - level 2 protects against crystal spike (Ethereal mod) + - level 3 protects against fire + - level 4 unused + - level 5 protects against lava + +**Example** + + armor:register_armor("mod_name:fire_proof_jacket", { + description = "Fire Proof Jacket", + inventory_image = "mod_name_inv_fire_proof_jacket.png", + groups = {armor_torso=1, armor_fire=3, armor_use=1000}, + armor_groups = {fleshy=10}, + damage_groups = {cracky=2, snappy=1, choppy=1, level=3}, + }) + +#### Armor_water +***"Armor_water"*** will periodically restore a players breath when underwater. This only has one level or state, which is armor_water=1 + +**Example** + + armor:register_armor("mod_name:helmet_underwater_breath", { + description = "Helmet of Underwater Breathing", + inventory_image = "mod_name_inv_helmet_underwater_breath.png", + groups = {armor_head=1, armor_water=1, armor_use=1000}, + armor_groups = {fleshy=5}, + damage_groups = {cracky=2, snappy=1, choppy=1, level=3}, + }) + +### Physics +The physics attributes supported by 3d_armor are ***physics_jump, physics_speed and physics_gravity***. Although 3d_armor supports the use of this with no other mods it is recommended that the mod [player_monoids](https://forum.minetest.net/viewtopic.php?t=14895) is used to help with intermod compatability. + +***physics_jump*** - Will increase/decrease the jump strength of the player so they can jump more/less. The base number is "1" and any value is added or subtracted, supports fractional so "physics_jump=1" will increase jump strength by 100%. "physics_jump= -0.5" will decrease jump by 50%. + +***physics_speed*** - Will increase/decrease the walk speed of the player so they walk faster/slower. The base number is "1" and any value is added or subtracted, supports fractional so "physics_speed=1.5" will increase speed by 150%, "physics_speed= -0.5" will decrease speed by 50%. + +***physics_gravity*** - Will increase/decrease gravity the player experiences so it's higher/lower. The base number is "1" and any value is added or subtracted, supports fractional so "physics_gravity=2" will increase gravity by 200%, "physics_gravity= -1" will decrease gravity by 100%. + +*Note: The player physics modifications won't be applied via `set_physics_override` if `player_physics_locked` is set to 1 in the respective player's meta.* + +### Durability +Durability is determined by the value assigned to the group ***armor_use***. The higher the ***armor_use*** value the faster/more quickly it is damaged/degrades. This is calculated using the formula: + + Total uses = approx(65535/armor_use) + + **Example** + All wood armor items have an ***armor_use=2000***; + + 65535/2000 = 32.76 (32) + After 32 uses(hits) the armor item will break. + + All diamond armor items have an ***armor_use=200***; + + 65535/2000 = 327.6 (327) + After 327 uses(hits) the armor item will break. + +## Armor Functions + +### armor set_player_armor + + armor:set_player_armor(player) + +Primarily an internal function but can be called externally to apply any +changes that might not otherwise get handled. + +### armor punch + + armor:punch(player, hitter, time_from_last_punch, tool_capabilities) + +Used to apply damage to all equipped armor based on the damage groups of +each individual item.`hitter`, `time_from_last_punch` and `tool_capabilities` +are optional but should be valid if included. + +### armor damage + + armor:damage(player, index, stack, use) + +Adds wear to a single armor itemstack, triggers `on_damage` callbacks and +updates the necessary inventories. Also handles item destruction callbacks +and so should NOT be called from `on_unequip` to avoid an infinite loop. + +### armor remove_all + + armor:remove_all(player) + +Removes all armors from the player's inventory without triggering any callback. + +### armor equip + + armor:equip(player, armor_name) + +Equip the armor, removing the itemstack from the main inventory if there's one. + +### armor unequip + + armor:unequip(player, armor_name) + +Unequip the armor, adding the itemstack to the main inventory. + +### armor update_skin + + armor:update_skin(player_name) + +Triggers a skin update with the same action as if a field with `skins_set` was submitted. + +## Callbacks + +### Item Callbacks + +In all of the below when armor is destroyed `stack` will contain a copy of the previous stack. + +*unsure what this note means may apply to all item callbacks or just on_punched* +Return `false` to override armor damage effects. + +#### on_equip + + on_equip = func(player, index, stack) + +#### on_unequip + + on_unequip = func(player, index, stack) + +#### on_destroy + + on_destroy = func(player, index, stack) + +#### on_damage + + on_damage = func(player, index, stack) + +#### on_punched + + on_punched = func(player, hitter, time_from_last_punch, tool_capabilities) + +`on_punched` is called every time a player is punched or takes damage, `hitter`, `time_from_last_punch` and `tool_capabilities` can be `nil` and will be in the case of fall damage. +When fire protection is enabled, hitter == "fire" in the event of fire damage. + + +### Global Callbacks + +#### armor register_on_update + + armor:register_on_update(function(player)) + +#### armor register_on_equip + + armor:register_on_equip(function(player, index, stack)) + +#### armor register_on_unequip + + armor:register_on_unequip(function(player, index, stack)) + +#### armor register_on_destroy +armor:register_on_destroy(function(player, index, stack)) + + **Example** + + armor:register_on_update(function(player) + print(player:get_player_name().." armor updated!") + end) + + +# Credits + +### The below have added too, tested or in other ways contributed to the development and ongoing support of 3d_Armor + +|Stu |Stujones11 |Stu |Github Ghosts | +|:---------------:|:---------------:|:---------------:|:---------------:| +|Pavel_S |BlockMen |Tenplus1 |donat-b | +|JPRuehmann |BrandonReese |Megaf |Zeg9 | +|poet.nohit |Echoes91 |Adimgar |Khonkhortisan | +|VanessaE |CraigyDavi |proller |Thomasrudin | +|Byakuren |kilbith (jp) |afflatus |G1ov4 | +|Thomas-S |Dragonop |Napiophelios |Emojigit | +|rubenwardy |daviddoesminetest|bell07 |OgelGames | +|tobyplowy |crazyginger72 |fireglow |bhree | +|Lone_Wolf(HT) |Wuzzy(2) |numberZero |Monte48 | +|AntumDeluge |Terumoc |runsy |Dacmot | +|codexp |davidthecreator |SmallJoker |orbea | +|BuckarooBanzay |daret |Exeterdad |Calinou | +|Pilcrow182 |indriApollo |HybridDog |CraigyDavi | +|Paly-2 |Diogogomes | | | + +*Note: Names gathered from 3d_armor forum thread and github, I may have missed some people, apologises if I have - S01* diff --git a/mods/3d_armor/3d_armor/README.txt b/mods/3d_armor/3d_armor/README.txt deleted file mode 100644 index b8980b57..00000000 --- a/mods/3d_armor/3d_armor/README.txt +++ /dev/null @@ -1,212 +0,0 @@ -[mod] Visible Player Armor [3d_armor] -===================================== - -Depends: default - -Recommends: sfinv, unified_inventory or smart_inventory (use only one to avoid conflicts) - -Supports: player_monoids and armor_monoid - -Adds craftable armor that is visible to other players. Each armor item worn contributes to -a player's armor group level making them less vulnerable to weapons. - -Armor takes damage when a player is hurt but also offers a percentage chance of healing. -Overall level is boosted by 10% when wearing a full matching set. - -Fire protection added by TenPlus1 when using crystal armor if Ethereal mod active, level 1 -protects against torches, level 2 for crystal spike, level 3 for fire, level 5 for lava. - -Armor Configuration -------------------- - -Override the following default settings by adding them to your minetest.conf file. - --- Set false to disable individual armor materials. -armor_material_wood = true -armor_material_cactus = true -armor_material_steel = true -armor_material_bronze = true -armor_material_diamond = true -armor_material_gold = true -armor_material_mithril = true -armor_material_crystal = true - --- Increase this if you get initialization glitches when a player first joins. -armor_init_delay = 2 - --- Number of initialization attempts. --- Use in conjunction with armor_init_delay if initialization problems persist. -armor_init_times = 10 - --- Increase this if armor is not getting into bones due to server lag. -armor_bones_delay = 1 - --- How often player armor items are updated. -armor_update_time = 1 - --- Drop armor when a player dies. --- Uses bones mod if present, otherwise items are dropped around the player. -armor_drop = true - --- Pulverise armor when a player dies, overrides armor_drop. -armor_destroy = false - --- You can use this to increase or decrease overall armor effectiveness, --- eg: level_multiplier = 0.5 will reduce armor level by half. -armor_level_multiplier = 1 - --- You can use this to increase or decrease overall armor healing, --- eg: armor_heal_multiplier = 0 will disable healing altogether. -armor_heal_multiplier = 1 - --- Enable water protection (periodically restores breath when activated) -armor_water_protect = true - --- Enable fire protection (defaults true if using ethereal mod) -armor_fire_protect = false - --- Enable punch damage effects. -armor_punch_damage = true - --- Enable migration of old armor inventories -armor_migrate_old_inventory = true - -API ---- - -Armor Registration: - -armor:register_armor(name, def) - -Wrapper function for `minetest.register_tool`, while registering armor as -a tool item is still supported, this may be deprecated in future so new code -should use this method. - -Additional fields supported by 3d_armor: - - texture = - preview = - armor_groups =
- damage_groups =
- reciprocate_damage = - on_equip = - on_unequip = - on_destroy = - on_damage = - on_punched = - -armor:register_armor_group(group, base) - -Example: - -armor:register_armor_group("radiation", 100) - -armor:register_armor("mod_name:speed_boots", { - description = "Speed Boots", - inventory_image = "mod_name_speed_boots_inv.png", - texture = "mod_name_speed_boots.png", - preview = "mod_name_speed_boots_preview.png", - groups = {armor_feet=1, armor_use=500, physics_speed=1.2, flammable=1}, - armor_groups = {fleshy=10, radiation=10}, - damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1}, - reciprocate_damage = true, - on_destroy = function(player, index, stack) - local pos = player:get_pos() - if pos then - minetest.sound_play({ - name = "mod_name_break_sound", - pos = pos, - gain = 0.5, - }) - end - end, -}) - -See armor.lua, technic_armor and shields mods for more examples. - -Default groups: - -Elements: armor_head, armor_torso, armor_legs, armor_feet -Attributes: armor_heal, armor_fire, armor_water -Physics: physics_jump, physics_speed, physics_gravity -Durability: armor_use, flammable - -Notes: - -Elements may be modified by dependent mods, eg shields adds armor_shield. -Attributes and physics values are 'stackable', durability is determined -by the level of armor_use, total uses == approx (65535/armor_use), non-fleshy -damage groups need to be defined in the tool/weapon used against the player. - -Reciprocal tool damage will be done only by the first armor inventory item - with `reciprocate_damage = true` - -Armor Functions: - -armor:set_player_armor(player) - -Primarily an internal function but can be called externally to apply any -changes that might not otherwise get handled. - -armor:punch(player, hitter, time_from_last_punch, tool_capabilities) - -Used to apply damage to all equipped armor based on the damage groups of -each individual item.`hitter`, `time_from_last_punch` and `tool_capabilities` -are optional but should be valid if included. - -armor:damage(player, index, stack, use) - -Adds wear to a single armor itemstack, triggers `on_damage` callbacks and -updates the necessary inventories. Also handles item destruction callbacks -and so should NOT be called from `on_unequip` to avoid an infinite loop. - -armor:remove_all(player) - -Removes all armors from the player's inventory without triggering any callback. - -armor:equip(player, armor_name) - -Equip the armor, removing the itemstack from the main inventory if there's one. - -armor:unequip(player, armor_name) - -Unequip the armor, adding the itemstack to the main inventory. - -armor:update_skin(player_name) - -Triggers a skin update with the same action as if a field with `skins_set` was submitted. - -Item Callbacks: - -on_equip = func(player, index, stack) -on_unequip = func(player, index, stack) -on_destroy = func(player, index, stack) -on_damage = func(player, index, stack) -on_punched = func(player, hitter, time_from_last_punch, tool_capabilities) - -Notes: - -`on_punched` is called every time a player is punched or takes damage, `hitter`, -`time_from_last_punch` and `tool_capabilities` can be `nil` and will be in the -case of fall damage, etc. When fire protection is enabled, hitter == "fire" -in the event of fire damage. Return `false` to override armor damage effects. -When armor is destroyed `stack` will contain a copy of the previous stack. - -Global Callbacks: - -armor:register_on_update(func(player)) -armor:register_on_equip(func(player, index, stack)) -armor:register_on_unequip(func(player, index, stack)) -armor:register_on_destroy(func(player, index, stack)) - -Global Callback Example: - -armor:register_on_update(function(player) - print(player:get_player_name().." armor updated!") -end) - - -Note: - -The player physics modifications won't be applied via `set_physics_override` if `player_physics_locked` is set to 1 -in the respective player's meta. diff --git a/mods/3d_armor/3d_armor/api.lua b/mods/3d_armor/3d_armor/api.lua index 34f0bc65..38e9898d 100644 --- a/mods/3d_armor/3d_armor/api.lua +++ b/mods/3d_armor/3d_armor/api.lua @@ -97,6 +97,7 @@ armor.config = { material_crystal = true, water_protect = true, fire_protect = minetest.get_modpath("ethereal") ~= nil, + fire_protect_torch = minetest.get_modpath("ethereal") ~= nil, punch_damage = true, } @@ -356,6 +357,9 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili local groupcaps = tool_capabilities.groupcaps or {} local uses = 0 damage = false + if next(groupcaps) == nil then + damage = true + end for group, caps in pairs(groupcaps) do local maxlevel = caps.maxlevel or 0 local diff = maxlevel - level diff --git a/mods/3d_armor/3d_armor/init.lua b/mods/3d_armor/3d_armor/init.lua index c3562347..a804e147 100644 --- a/mods/3d_armor/3d_armor/init.lua +++ b/mods/3d_armor/3d_armor/init.lua @@ -62,6 +62,17 @@ for material, _ in pairs(armor.materials) do end end +-- Remove torch damage if fire_protect_torch == false +if armor.config.fire_protect_torch == false and armor.config.fire_protect == true then + for k,v in pairs(armor.fire_nodes) do + for k2,v2 in pairs(v) do + if string.find (v2,"torch") then + armor.fire_nodes[k] = nil + end + end + end +end + -- Mod Compatibility if minetest.get_modpath("technic") then diff --git a/mods/3d_armor/README.md b/mods/3d_armor/README.md index 7bfefc00..57bcf62a 100644 --- a/mods/3d_armor/README.md +++ b/mods/3d_armor/README.md @@ -1,5 +1,7 @@ Modpack - 3d Armor [0.4.13] =========================== +![3d_armor screenshot](https://github.com/minetest-mods/3d_armor/blob/master/screenshot.png) + ![](https://github.com/minetest-mods/3d_armor/workflows/luacheck/badge.svg) ![](https://github.com/minetest-mods/3d_armor/workflows/integration-test/badge.svg) diff --git a/mods/3d_armor/screenshot.png b/mods/3d_armor/screenshot.png index c1f9e582..637944a0 100644 Binary files a/mods/3d_armor/screenshot.png and b/mods/3d_armor/screenshot.png differ diff --git a/mods/3d_armor/screenshot.xcf b/mods/3d_armor/screenshot.xcf new file mode 100644 index 00000000..17ea7c98 Binary files /dev/null and b/mods/3d_armor/screenshot.xcf differ diff --git a/mods/3d_armor/settingtypes.txt b/mods/3d_armor/settingtypes.txt index c6c90de0..69a1b936 100644 --- a/mods/3d_armor/settingtypes.txt +++ b/mods/3d_armor/settingtypes.txt @@ -44,6 +44,9 @@ armor_water_protect (Enable water protection) bool true # Enable fire protection (defaults true if using ethereal mod). armor_fire_protect (Enable fire protection) bool false +# Enable fire damage from torches (defaults true if using ethereal mod). +armor_fire_protect_torch (Enable fire protection torch damage) bool false + # Enable punch damage effects. armor_punch_damage (Enable damage effects) bool true diff --git a/mods/Minetest-WorldEdit/worldedit_gui/init.lua b/mods/Minetest-WorldEdit/worldedit_gui/init.lua index 424d61f0..08ecc1bd 100644 --- a/mods/Minetest-WorldEdit/worldedit_gui/init.lua +++ b/mods/Minetest-WorldEdit/worldedit_gui/init.lua @@ -80,6 +80,9 @@ if minetest.global_exists("unified_inventory") then -- unified inventory install unified_inventory.register_button("worldedit_gui", { type = "image", image = "inventory_plus_worldedit_gui.png", + condition = function(player) + return minetest.check_player_privs(player:get_player_name(), {worldedit=true}) + end, }) minetest.register_on_player_receive_fields(function(player, formname, fields) diff --git a/mods/advtrains/advtrains/tracks.lua b/mods/advtrains/advtrains/tracks.lua index 60969df4..13623a5c 100644 --- a/mods/advtrains/advtrains/tracks.lua +++ b/mods/advtrains/advtrains/tracks.lua @@ -307,7 +307,7 @@ advtrains.ap.t_90plusx_crossing={ trackworker = "60r", }, ["60r"]={ - conns = { {c=0}, {c=8}, {c=7}, {c=15} }, + conns = { {c=0}, {c=8}, {c=7}, {c=13} }, desc = "60/90 degree crossing (right)", tpdouble = true, tpsingle = true, diff --git a/mods/bonemeal/init.lua b/mods/bonemeal/init.lua index 3a611be5..6f289224 100644 --- a/mods/bonemeal/init.lua +++ b/mods/bonemeal/init.lua @@ -181,7 +181,7 @@ local function check_sapling(pos, nodename) if can_grow then particle_effect(pos) grow_tree(pos, saplings[n][2]) - return + return true end end end @@ -216,7 +216,7 @@ local function check_crops(pos, nodename, strength) particle_effect(pos) - return + return true end end end @@ -438,13 +438,13 @@ function bonemeal:on_use(pos, strength, node) default.grow_papyrus(pos, node) particle_effect(pos) - return + return true elseif node.name == "default:cactus" then default.grow_cactus(pos, node) particle_effect(pos) - return + return true end -- grow grass and flowers @@ -452,7 +452,7 @@ function bonemeal:on_use(pos, strength, node) or minetest.get_item_group(node.name, "sand") > 0 or minetest.get_item_group(node.name, "can_bonemeal") > 0 then check_soil(pos, node.name, strength) - return + return true end -- light check depending on strength (strength of 4 = no light needed) @@ -464,11 +464,13 @@ function bonemeal:on_use(pos, strength, node) if minetest.get_item_group(node.name, "sapling") > 0 and random(5 - strength) == 1 then check_sapling(pos, node.name) - return + return true end -- check for crop growth - check_crops(pos, node.name, strength) + if check_crops(pos, node.name, strength) then + return true + end end @@ -494,13 +496,14 @@ minetest.register_craftitem("bonemeal:mulch", { return end - -- take item if not in creative - if not bonemeal.is_creative(user:get_player_name()) then - itemstack:take_item() - end - -- call global on_use function with strength of 1 - bonemeal:on_use(pointed_thing.under, 1) + if bonemeal:on_use(pointed_thing.under, 1) then + + -- take item if not in creative + if not bonemeal.is_creative(user:get_player_name()) then + itemstack:take_item() + end + end return itemstack end @@ -524,13 +527,14 @@ minetest.register_craftitem("bonemeal:bonemeal", { return end - -- take item if not in creative - if not bonemeal.is_creative(user:get_player_name()) then - itemstack:take_item() - end - -- call global on_use function with strength of 2 - bonemeal:on_use(pointed_thing.under, 2) + if bonemeal:on_use(pointed_thing.under, 2) then + + -- take item if not in creative + if not bonemeal.is_creative(user:get_player_name()) then + itemstack:take_item() + end + end return itemstack end @@ -554,13 +558,14 @@ minetest.register_craftitem("bonemeal:fertiliser", { return end - -- take item if not in creative - if not bonemeal.is_creative(user:get_player_name()) then - itemstack:take_item() - end - -- call global on_use function with strength of 3 - bonemeal:on_use(pointed_thing.under, 3) + if bonemeal:on_use(pointed_thing.under, 3) then + + -- take item if not in creative + if not bonemeal.is_creative(user:get_player_name()) then + itemstack:take_item() + end + end return itemstack end diff --git a/mods/bonemeal/mods.lua b/mods/bonemeal/mods.lua index ace943f2..9e3a63ce 100644 --- a/mods/bonemeal/mods.lua +++ b/mods/bonemeal/mods.lua @@ -32,7 +32,7 @@ if farming and farming.mod and farming.mod == "redo" then {"farming:chili_", 8}, {"farming:garlic_", 5}, {"farming:onion_", 5}, - {"farming:pepper_", 5}, + {"farming:pepper_", 7}, {"farming:pineapple_", 8}, {"farming:pea_", 5}, {"farming:beetroot_", 5}, @@ -40,7 +40,11 @@ if farming and farming.mod and farming.mod == "redo" then {"farming:oat_", 8}, {"farming:rice_", 8}, {"farming:mint_", 4}, - {"farming:cabbage_", 6} + {"farming:cabbage_", 6}, + {"farming:lettuce_", 5}, + {"farming:blackberry_", 4}, + {"farming:vanilla_", 8}, + {"farming:soy_", 7} }) end @@ -65,7 +69,9 @@ if minetest.get_modpath("ethereal") then {"ethereal:orange_tree_sapling", ethereal.grow_orange_tree, "soil"}, {"ethereal:bamboo_sprout", ethereal.grow_bamboo_tree, "soil"}, {"ethereal:birch_sapling", ethereal.grow_birch_tree, "soil"}, - {"ethereal:sakura_sapling", ethereal.grow_sakura_tree, "soil"} + {"ethereal:sakura_sapling", ethereal.grow_sakura_tree, "soil"}, + {"ethereal:lemon_tree_sapling", ethereal.grow_lemon_tree, "soil"}, + {"ethereal:olive_tree_sapling", ethereal.grow_olive_tree, "soil"} }) local grass = {"default:grass_3", "default:grass_4", "default:grass_5", ""} diff --git a/mods/farming/README.md b/mods/farming/README.md index 353d6f93..e442aacb 100644 --- a/mods/farming/README.md +++ b/mods/farming/README.md @@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t ### Changelog: +- 1.46 - Added min/max default light settings, added lettuce and blackberries with food items (thanks OgelGames), added soya and vanilla (thanks Felfa), added tofu - 1.45 - Dirt and Hoes are more in line with default by using dry/wet/base, added cactus juice, added pasta, spaghetti, cabbage, korean bibimbap, code tidy options, onion soup added (thanks edcrypt), Added apple pie, added wild cotton to savanna - 1.44 - Added 'farming_stage_length' in mod settings for speed of crop growth, also thanks to TheDarkTiger for translation updates diff --git a/mods/farming/crops/barley.lua b/mods/farming/crops/barley.lua index 69b30562..65d1f03e 100644 --- a/mods/farming/crops/barley.lua +++ b/mods/farming/crops/barley.lua @@ -108,8 +108,8 @@ minetest.register_node("farming:barley_7", table.copy(def)) farming.registered_plants["farming:barley"] = { crop = "farming:barley", seed = "farming:seed_barley", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 7 } diff --git a/mods/farming/crops/beans.lua b/mods/farming/crops/beans.lua index b469d085..38d8fa94 100644 --- a/mods/farming/crops/beans.lua +++ b/mods/farming/crops/beans.lua @@ -226,8 +226,8 @@ minetest.register_node("farming:beanpole_5", table.copy(def)) farming.registered_plants["farming:beans"] = { crop = "farming:beanpole", seed = "farming:beans", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 5 } diff --git a/mods/farming/crops/beetroot.lua b/mods/farming/crops/beetroot.lua index f20cfead..ef57986a 100644 --- a/mods/farming/crops/beetroot.lua +++ b/mods/farming/crops/beetroot.lua @@ -86,7 +86,7 @@ minetest.register_node("farming:beetroot_5", table.copy(def)) farming.registered_plants["farming:beetroot"] = { crop = "farming:beetroot", seed = "farming:beetroot", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 5 } diff --git a/mods/farming/crops/blackberry.lua b/mods/farming/crops/blackberry.lua new file mode 100644 index 00000000..e2122fde --- /dev/null +++ b/mods/farming/crops/blackberry.lua @@ -0,0 +1,62 @@ + +local S = farming.intllib + +-- blackberries +minetest.register_craftitem("farming:blackberry", { + description = S("Blackberries"), + inventory_image = "farming_blackberry.png", + groups = {seed = 2, food_blackberries = 1, food_blackberry = 1, + food_berry = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:blackberry_1") + end, + on_use = minetest.item_eat(1), +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_blackberry_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:blackberry_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_blackberry_2.png"} +minetest.register_node("farming:blackberry_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_blackberry_3.png"} +minetest.register_node("farming:blackberry_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_blackberry_4.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {'farming:blackberry 2'}, rarity = 1}, + {items = {'farming:blackberry'}, rarity = 2}, + {items = {'farming:blackberry'}, rarity = 3}, + } +} +minetest.register_node("farming:blackberry_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:blackberry"] = { + crop = "farming:blackberry", + seed = "farming:blackberry", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/mods/farming/crops/blueberry.lua b/mods/farming/crops/blueberry.lua index 38053ad4..e8d83c3a 100644 --- a/mods/farming/crops/blueberry.lua +++ b/mods/farming/crops/blueberry.lua @@ -88,7 +88,7 @@ minetest.register_node("farming:blueberry_4", table.copy(def)) farming.registered_plants["farming:blueberries"] = { crop = "farming:blueberry", seed = "farming:blueberries", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 4 } diff --git a/mods/farming/crops/cabbage.lua b/mods/farming/crops/cabbage.lua index 4a3c2e23..b57ac007 100644 --- a/mods/farming/crops/cabbage.lua +++ b/mods/farming/crops/cabbage.lua @@ -53,8 +53,8 @@ def.tiles = {"farming_cabbage_6.png"} def.groups.growing = nil def.drop = { max_items = 2, items = { - {items = {"farming:cabbage"}, rarity = 1}, - {items = {"farming:cabbage"}, rarity = 2} + {items = {"farming:cabbage 2"}, rarity = 1}, + {items = {"farming:cabbage 1"}, rarity = 2} } } minetest.register_node("farming:cabbage_6", table.copy(def)) @@ -63,7 +63,7 @@ minetest.register_node("farming:cabbage_6", table.copy(def)) farming.registered_plants["farming:cabbage"] = { crop = "farming:cabbage", seed = "farming:cabbage", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 6 } diff --git a/mods/farming/crops/carrot.lua b/mods/farming/crops/carrot.lua index f19338c8..8be1f4eb 100644 --- a/mods/farming/crops/carrot.lua +++ b/mods/farming/crops/carrot.lua @@ -118,7 +118,7 @@ minetest.register_node("farming:carrot_8", table.copy(def)) farming.registered_plants["farming:carrot"] = { crop = "farming:carrot", seed = "farming:carrot", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/chili.lua b/mods/farming/crops/chili.lua index 867c9455..43345566 100644 --- a/mods/farming/crops/chili.lua +++ b/mods/farming/crops/chili.lua @@ -95,7 +95,7 @@ minetest.register_node("farming:chili_8", table.copy(def)) farming.registered_plants["farming:chili_pepper"] = { crop = "farming:chili", seed = "farming:chili_pepper", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/cocoa.lua b/mods/farming/crops/cocoa.lua index 9e8a4041..72e37d04 100644 --- a/mods/farming/crops/cocoa.lua +++ b/mods/farming/crops/cocoa.lua @@ -194,8 +194,8 @@ minetest.register_node("farming:cocoa_4", table.copy(def)) farming.registered_plants["farming:cocoa_beans"] = { crop = "farming:cocoa", seed = "farming:cocoa_beans", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 4 } diff --git a/mods/farming/crops/coffee.lua b/mods/farming/crops/coffee.lua index f234573b..f64369c8 100644 --- a/mods/farming/crops/coffee.lua +++ b/mods/farming/crops/coffee.lua @@ -106,7 +106,7 @@ minetest.register_node("farming:coffee_5", table.copy(def)) farming.registered_plants["farming:coffee"] = { crop = "farming:coffee", seed = "farming:coffee_beans", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 5 } diff --git a/mods/farming/crops/corn.lua b/mods/farming/crops/corn.lua index 4835281e..0999fb99 100644 --- a/mods/farming/crops/corn.lua +++ b/mods/farming/crops/corn.lua @@ -153,7 +153,7 @@ minetest.register_node("farming:corn_8", table.copy(def)) farming.registered_plants["farming:corn"] = { crop = "farming:corn", seed = "farming:corn", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/cotton.lua b/mods/farming/crops/cotton.lua index 067b444b..6ea2e6fe 100644 --- a/mods/farming/crops/cotton.lua +++ b/mods/farming/crops/cotton.lua @@ -172,8 +172,8 @@ minetest.register_node("farming:cotton_8", table.copy(def)) farming.registered_plants["farming:cotton"] = { crop = "farming:cotton", seed = "farming:seed_cotton", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/cucumber.lua b/mods/farming/crops/cucumber.lua index fc15e479..c5e70def 100644 --- a/mods/farming/crops/cucumber.lua +++ b/mods/farming/crops/cucumber.lua @@ -59,7 +59,7 @@ minetest.register_node("farming:cucumber_4", table.copy(def)) farming.registered_plants["farming:cucumber"] = { crop = "farming:cucumber", seed = "farming:cucumber", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 4 } diff --git a/mods/farming/crops/garlic.lua b/mods/farming/crops/garlic.lua index 7fe75655..162bacec 100644 --- a/mods/farming/crops/garlic.lua +++ b/mods/farming/crops/garlic.lua @@ -129,7 +129,7 @@ minetest.register_node("farming:garlic_5", table.copy(def)) farming.registered_plants["farming:garlic"] = { crop = "farming:garlic", seed = "farming:garlic_clove", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 5 } diff --git a/mods/farming/crops/grapes.lua b/mods/farming/crops/grapes.lua index 5d13dc65..8c5e4586 100644 --- a/mods/farming/crops/grapes.lua +++ b/mods/farming/crops/grapes.lua @@ -233,8 +233,8 @@ minetest.register_node("farming:grapes_8", table.copy(def)) farming.registered_plants["farming:grapes"] = { crop = "farming:grapes", seed = "farming:grapes", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/hemp.lua b/mods/farming/crops/hemp.lua index 03ed4d2e..f8dfd0b5 100644 --- a/mods/farming/crops/hemp.lua +++ b/mods/farming/crops/hemp.lua @@ -256,7 +256,7 @@ minetest.register_node("farming:hemp_8", table.copy(def)) farming.registered_plants["farming:hemp"] = { crop = "farming:hemp", seed = "farming:seed_hemp", - minlight = 13, - maxlight = 15, + mminlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/lettuce.lua b/mods/farming/crops/lettuce.lua new file mode 100644 index 00000000..07ef43ad --- /dev/null +++ b/mods/farming/crops/lettuce.lua @@ -0,0 +1,63 @@ +local S = farming.intllib + +-- lettuce +minetest.register_craftitem("farming:lettuce", { + description = S("Lettuce"), + inventory_image = "farming_lettuce.png", + groups = {seed = 2, food_lettuce = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:lettuce_1") + end, + on_use = minetest.item_eat(2), +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_lettuce_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:lettuce_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_lettuce_2.png"} +minetest.register_node("farming:lettuce_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_lettuce_3.png"} +minetest.register_node("farming:lettuce_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_lettuce_4.png"} +minetest.register_node("farming:lettuce_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_lettuce_5.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {'farming:lettuce 2'}, rarity = 1}, + {items = {'farming:lettuce 1'}, rarity = 2}, + } +} +minetest.register_node("farming:lettuce_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:lettuce"] = { + crop = "farming:lettuce", + seed = "farming:lettuce", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/melon.lua b/mods/farming/crops/melon.lua index 6495a138..0549dd35 100644 --- a/mods/farming/crops/melon.lua +++ b/mods/farming/crops/melon.lua @@ -88,7 +88,7 @@ minetest.register_node("farming:melon_8", table.copy(def)) farming.registered_plants["farming:melon"] = { crop = "farming:melon", seed = "farming:melon_slice", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/mint.lua b/mods/farming/crops/mint.lua index ae0e6707..5bc40215 100644 --- a/mods/farming/crops/mint.lua +++ b/mods/farming/crops/mint.lua @@ -101,7 +101,7 @@ minetest.register_node("farming:mint_4", table.copy(def)) farming.registered_plants["farming:mint"] = { crop = "farming:mint", seed = "farming:seed_mint", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 4 } diff --git a/mods/farming/crops/onion.lua b/mods/farming/crops/onion.lua index 30c9bc37..2a8c63f3 100644 --- a/mods/farming/crops/onion.lua +++ b/mods/farming/crops/onion.lua @@ -90,7 +90,7 @@ minetest.register_node("farming:onion_5", table.copy(def)) farming.registered_plants["farming:onion"] = { crop = "farming:onion", seed = "farming:onion", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 5 } diff --git a/mods/farming/crops/peas.lua b/mods/farming/crops/peas.lua index 0c8e40c9..7c6a83df 100644 --- a/mods/farming/crops/peas.lua +++ b/mods/farming/crops/peas.lua @@ -91,7 +91,7 @@ minetest.register_node("farming:pea_5", table.copy(def)) farming.registered_plants["farming:pea_pod"] = { crop = "farming:pea", seed = "farming:pea_pod", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 5 } diff --git a/mods/farming/crops/pepper.lua b/mods/farming/crops/pepper.lua index 4d5baf83..086a0c60 100644 --- a/mods/farming/crops/pepper.lua +++ b/mods/farming/crops/pepper.lua @@ -19,16 +19,32 @@ minetest.register_craftitem("farming:peppercorn", { -- green pepper minetest.register_craftitem("farming:pepper", { - description = S("Pepper"), + description = S("Green Pepper"), inventory_image = "crops_pepper.png", on_use = minetest.item_eat(2), groups = {food_pepper = 1, flammable = 3} }) +-- yellow pepper +minetest.register_craftitem("farming:pepper_yellow", { + description = S("Yellow Pepper"), + inventory_image = "crops_pepper_yellow.png", + on_use = minetest.item_eat(3), + groups = {food_pepper = 1, flammable = 3}, +}) + +-- red pepper +minetest.register_craftitem("farming:pepper_red", { + description = S("Red Pepper"), + inventory_image = "crops_pepper_red.png", + on_use = minetest.item_eat(4), + groups = {food_pepper = 1, flammable = 3}, +}) + minetest.register_craft({ type = "shapeless", output = "farming:peppercorn", - recipe = {"farming:pepper"} + recipe = {"group:food_pepper"} }) -- ground pepper @@ -93,11 +109,10 @@ minetest.register_node("farming:pepper_3", table.copy(def)) def.tiles = {"crops_pepper_plant_4.png"} minetest.register_node("farming:pepper_4", table.copy(def)) --- stage 5 +-- stage 5 (green pepper) def.tiles = {"crops_pepper_plant_5.png"} -def.groups.growing = 0 def.drop = { - items = { + max_items = 2, items = { {items = {"farming:pepper 2"}, rarity = 1}, {items = {"farming:pepper"}, rarity = 2}, {items = {"farming:pepper"}, rarity = 3} @@ -105,11 +120,34 @@ def.drop = { } minetest.register_node("farming:pepper_5", table.copy(def)) +-- stage 6 (yellow pepper) +def.tiles = {"crops_pepper_plant_6.png"} +def.drop = { + max_items = 2, items = { + {items = {'farming:pepper_yellow 2'}, rarity = 1}, + {items = {'farming:pepper_yellow'}, rarity = 2}, + {items = {'farming:pepper_yellow'}, rarity = 3}, + } +} +minetest.register_node("farming:pepper_6", table.copy(def)) + +-- stage 7 (red pepper) +def.tiles = {"crops_pepper_plant_7.png"} +def.groups.growing = nil +def.drop = { + max_items = 2, items = { + {items = {'farming:pepper_red 2'}, rarity = 1}, + {items = {'farming:pepper_red'}, rarity = 2}, + {items = {'farming:pepper_red'}, rarity = 3}, + } +} +minetest.register_node("farming:pepper_7", table.copy(def)) + -- add to registered_plants farming.registered_plants["farming:pepper"] = { crop = "farming:pepper", seed = "farming:peppercorn", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 5 } diff --git a/mods/farming/crops/pineapple.lua b/mods/farming/crops/pineapple.lua index f57ccf0f..839a627a 100644 --- a/mods/farming/crops/pineapple.lua +++ b/mods/farming/crops/pineapple.lua @@ -135,7 +135,7 @@ minetest.register_node("farming:pineapple_8", table.copy(def)) farming.registered_plants["farming:pineapple"] = { crop = "farming:pineapple", seed = "farming:pineapple_top", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/potato.lua b/mods/farming/crops/potato.lua index 8c087d0c..a55ab298 100644 --- a/mods/farming/crops/potato.lua +++ b/mods/farming/crops/potato.lua @@ -106,7 +106,7 @@ minetest.register_node("farming:potato_4", table.copy(def)) farming.registered_plants["farming:potato"] = { crop = "farming:potato", seed = "farming:potato", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 4 } diff --git a/mods/farming/crops/pumpkin.lua b/mods/farming/crops/pumpkin.lua index 1b0b8c45..5e29c015 100644 --- a/mods/farming/crops/pumpkin.lua +++ b/mods/farming/crops/pumpkin.lua @@ -200,7 +200,7 @@ minetest.register_alias("farming:pumpkin", "farming:pumpkin_8") farming.registered_plants["farming:pumpkin"] = { crop = "farming:pumpkin", seed = "farming:pumpkin_slice", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/raspberry.lua b/mods/farming/crops/raspberry.lua index 0914aa40..df1d3d94 100644 --- a/mods/farming/crops/raspberry.lua +++ b/mods/farming/crops/raspberry.lua @@ -74,7 +74,7 @@ minetest.register_node("farming:raspberry_4", table.copy(def)) farming.registered_plants["farming:raspberries"] = { crop = "farming:raspberry", seed = "farming:raspberries", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 4 } diff --git a/mods/farming/crops/rhubarb.lua b/mods/farming/crops/rhubarb.lua index bd44a713..073cc18f 100644 --- a/mods/farming/crops/rhubarb.lua +++ b/mods/farming/crops/rhubarb.lua @@ -71,7 +71,7 @@ minetest.register_node("farming:rhubarb_3", table.copy(def)) farming.registered_plants["farming:rhubarb"] = { crop = "farming:rhubarb", seed = "farming:rhubarb", - minlight = 13, - maxlight = 15, + minlight = 10, + maxlight = 12, steps = 3 } diff --git a/mods/farming/crops/soy.lua b/mods/farming/crops/soy.lua new file mode 100644 index 00000000..cb71c67d --- /dev/null +++ b/mods/farming/crops/soy.lua @@ -0,0 +1,171 @@ + +local S = farming.intllib + +-- soy pod +minetest.register_craftitem("farming:soy_pod", { + description = S("Soy Pod"), + inventory_image = "farming_soy_pod.png", + groups = {seed = 2, food_soy_pod = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:soy_1") + end +}) + +minetest.register_craftitem("farming:soy_beans", { + description = S("Soy Beans"), + inventory_image = "farming_soy_beans.png", + groups = {food_soy = 1, flammable = 2}, + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:soy_beans", + recipe = {"farming:soy_pod"} +}) + +-- soy milk +minetest.register_node("farming:soy_milk", { + description = S("Soy Milk"), + drawtype = "plantlike", + tiles = {"farming_soy_milk_glass.png"}, + inventory_image = "farming_soy_milk_glass.png", + wield_image = "farming_soy_milk_glass.png", + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + on_use = minetest.item_eat(2, "vessels:drinking_glass"), + groups = { + vessel = 1, food_milk_glass = 1, dig_immediate = 3, + attached_node = 1, drink = 1 + }, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_craft( { + type = "shapeless", + output = "farming:soy_milk", + recipe = { + "group:food_soy", "group:food_soy", "group:food_soy", + "farming:vanilla_extract", "bucket:bucket_water", "vessels:drinking_glass" + }, + replacements = { + {"bucket:bucket_water", "bucket:bucket_empty"}, + {"farming:vanilla_extract", "vessels:glass_bottle"} + } +}) + +-- tofu +minetest.register_craftitem("farming:tofu", { + description = S("Tofu"), + inventory_image = "farming_tofu.png", + groups = {food_tofu = 1, food_meat_raw = 1, flammable = 2}, + on_use = minetest.item_eat(3) +}) + +minetest.register_craft({ + output = "farming:tofu", + type = "shapeless", + recipe = { + "farming:baking_tray", "group:food_soy", "group:food_soy", + "group:food_soy", "group:food_soy", "group:food_soy", + }, + replacements = {{"farming:baking_tray", "farming:baking_tray"}} +}) + +-- cooked tofu +minetest.register_craftitem("farming:tofu_cooked", { + description = S("Cooked Tofu"), + inventory_image = "farming_tofu_cooked.png", + groups = {food_meat = 1, flammable = 2}, + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + type = "cooking", + output = "farming:tofu_cooked", + recipe = "farming:tofu", + cooktime = 5 +}) + +-- crop definition + +local def = { + drawtype = "plantlike", + tiles = {"farming_soy_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:soy_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_soy_2.png"} +minetest.register_node("farming:soy_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_soy_3.png"} +minetest.register_node("farming:soy_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_soy_4.png"} +minetest.register_node("farming:soy_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_soy_5.png"} +def.drop = { + max_items = 1, items = { + {items = {'farming:soy_pod'}, rarity = 1}, + } +} +minetest.register_node("farming:soy_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_soy_6.png"} +def.drop = { + max_items = 3, items = { + {items = {'farming:soy_pod'}, rarity = 1}, + {items = {'farming:soy_pod'}, rarity = 2}, + {items = {'farming:soy_pod'}, rarity = 3}, + } +} +minetest.register_node("farming:soy_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_soy_7.png"} +def.groups.growing = nil +def.drop = { + max_items = 5, items = { + {items = {'farming:soy_pod'}, rarity = 1}, + {items = {'farming:soy_pod'}, rarity = 2}, + {items = {'farming:soy_pod'}, rarity = 3}, + {items = {'farming:soy_pod'}, rarity = 4}, + {items = {'farming:soy_pod'}, rarity = 5} + } +} +minetest.register_node("farming:soy_7", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:soy_pod"] = { + crop = "farming:soy", + seed = "farming:soy_pod", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 7 +} diff --git a/mods/farming/crops/tomato.lua b/mods/farming/crops/tomato.lua index 79058282..47879b64 100644 --- a/mods/farming/crops/tomato.lua +++ b/mods/farming/crops/tomato.lua @@ -83,7 +83,7 @@ minetest.register_node("farming:tomato_8", table.copy(def)) farming.registered_plants["farming:tomato"] = { crop = "farming:tomato", seed = "farming:tomato", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/crops/vanilla.lua b/mods/farming/crops/vanilla.lua new file mode 100644 index 00000000..17236a37 --- /dev/null +++ b/mods/farming/crops/vanilla.lua @@ -0,0 +1,122 @@ +local S = farming.intllib + +-- vanilla +minetest.register_craftitem("farming:vanilla", { + description = S("Vanilla"), + inventory_image = "farming_vanilla.png", + groups = {seed = 2, food_vanilla = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:vanilla_1") + end, + on_use = minetest.item_eat(1), +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"farming_vanilla_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- vanilla extract +minetest.register_node("farming:vanilla_extract", { + description = S("Vanilla Extract"), + drawtype = "plantlike", + tiles = {"farming_vanilla_extract.png"}, + inventory_image = "farming_vanilla_extract.png", + wield_image = "farming_vanilla_extract.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craft( { + output = "farming:vanilla_extract", + recipe = { + { "group:food_vanilla", "group:food_vanilla", "group:food_vanilla"}, + { "group:food_vanilla", "farming:bottle_ethanol", "bucket:bucket_water"}, + }, + replacements = { + {"bucket:bucket_water", "bucket:bucket_empty"}, + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:vanilla_extract", + burntime = 25, + replacements = {{ "farming:vanilla_extract", "vessels:glass_bottle" }} +}) + +-- stage 1 +minetest.register_node("farming:vanilla_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_vanilla_2.png"} +minetest.register_node("farming:vanilla_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_vanilla_3.png"} +minetest.register_node("farming:vanilla_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_vanilla_4.png"} +minetest.register_node("farming:vanilla_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_vanilla_5.png"} +minetest.register_node("farming:vanilla_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_vanilla_6.png"} +def.visual_scale = 1.9 +minetest.register_node("farming:vanilla_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_vanilla_7.png"} +def.drop = { + items = { + {items = {'farming:vanilla'}, rarity = 1}, + {items = {'farming:vanilla'}, rarity = 2}, + {items = {'farming:vanilla'}, rarity = 3} + } +} +minetest.register_node("farming:vanilla_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_vanilla_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {'farming:vanilla 2'}, rarity = 1}, + {items = {'farming:vanilla 2'}, rarity = 2}, + {items = {'farming:vanilla 2'}, rarity = 2}, + {items = {'farming:vanilla 2'}, rarity = 3} + } +} +minetest.register_node("farming:vanilla_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:vanilla"] = { + crop = "farming:vanilla", + seed = "farming:vanilla", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/wheat.lua b/mods/farming/crops/wheat.lua index 7a8f19b9..e21d7f67 100644 --- a/mods/farming/crops/wheat.lua +++ b/mods/farming/crops/wheat.lua @@ -234,8 +234,8 @@ minetest.register_node("farming:wheat_8", table.copy(def)) farming.registered_plants["farming:wheat"] = { crop = "farming:wheat", seed = "farming:seed_wheat", - minlight = 13, - maxlight = 15, + minlight = farming.min_light, + maxlight = farming.max_light, steps = 8 } diff --git a/mods/farming/farming.conf_example b/mods/farming/farming.conf_example index 68a7bcbf..bea7ada8 100644 --- a/mods/farming/farming.conf_example +++ b/mods/farming/farming.conf_example @@ -31,7 +31,15 @@ farming.peas = 0.001 farming.beetroot = 0.001 farming.mint = 0.005 farming.cabbage = 0.001 +farming.blackberry = 0.002 +farming.lettuce = 0.001 +farming.soy = 0.001 +farming.vanilla = 0.001 farming.grains = true -- true or false only -- default rarety of crops on map (higher number = more crops) farming.rarety = 0.002 + +-- default minimum and maximum light levels crops need to grow +farming.min_light = 12 +farming.max_light = 15 diff --git a/mods/farming/food.lua b/mods/farming/food.lua index edf80458..70892461 100644 --- a/mods/farming/food.lua +++ b/mods/farming/food.lua @@ -181,44 +181,18 @@ minetest.register_craftitem("farming:porridge", { on_use = minetest.item_eat(6, "farming:bowl") }) -minetest.after(0, function() - - local fluid = "group:water_bucket" - local fluid_return = { - {"group:water_bucket", "bucket:bucket_empty"}, - {"group:water_bucket_wooden", "bucket:bucket_empty"} +minetest.register_craft({ + type = "shapeless", + output = "farming:porridge", + recipe = { + "group:food_oats", "group:food_oats", "group:food_oats", + "group:food_oats", "group:food_bowl", "group:food_milk_glass" + }, + replacements = { + {"mobs:glass_milk", "vessels:drinking_glass"}, + {"farming:soy_milk", "vessels:drinking_glass"} } - - if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then - fluid = "group:food_milk" - fluid_return = { - {"mobs:bucket_milk", "bucket:bucket_empty"} - } - else - minetest.register_craft({ - type = "shapeless", - output = "farming:porridge", - recipe = { - "group:food_oats", "group:food_oats", "group:food_oats", - "group:food_oats", "group:food_bowl", "group:water_bucket_wooden" - }, - replacements = fluid_return - }) - end - - minetest.register_craft({ - type = "shapeless", - output = "farming:porridge", - recipe = { - "group:food_oats", "group:food_oats", "group:food_oats", - "group:food_oats", "group:food_bowl", fluid - }, - replacements = fluid_return - }) - - if minetest.get_modpath("bucket_wooden") then - end -end) +}) --= Jaffa Cake @@ -373,3 +347,57 @@ minetest.register_craft({ replacements = {{"group:food_skillet", "farming:skillet"}} }) end + +-- Burger + +minetest.register_craftitem("farming:burger", { + description = S("Burger"), + inventory_image = "farming_burger.png", + on_use = minetest.item_eat(16), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:burger", + recipe = { + "farming:bread", "group:food_meat", "group:food_cheese", + "group:food_tomato", "group:food_cucumber", "group:food_onion", + "group:food_lettuce" + } +}) + +-- Salad + +minetest.register_craftitem("farming:salad", { + description = S("Salad"), + inventory_image = "farming_salad.png", + on_use = minetest.item_eat(8, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:salad", + type = "shapeless", + recipe = { + "group:food_bowl", "group:food_tomato", "group:food_cucumber", + "group:food_lettuce", "group:food_oil" + }, +}) + +-- Triple Berry Smoothie + +minetest.register_craftitem("farming:smoothie_berry", { + description = S("Triple Berry Smoothie"), + inventory_image = "farming_berry_smoothie.png", + on_use = minetest.item_eat(6, "vessels:drinking_glass"), + groups = {vessel = 1, drink = 1} +}) + +minetest.register_craft({ + output = "farming:smoothie_berry", + type = "shapeless", + recipe = { + "group:food_raspberries", "group:food_blackberries", + "group:food_strawberry", "group:food_banana", + "vessels:drinking_glass" + } +}) diff --git a/mods/farming/init.lua b/mods/farming/init.lua index fd2aa21f..973c807e 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -7,13 +7,15 @@ farming = { mod = "redo", - version = "20200702", + version = "20201213", path = minetest.get_modpath("farming"), select = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5} }, - registered_plants = {} + registered_plants = {}, + min_light = 12, + max_light = 15 } @@ -332,9 +334,8 @@ function farming.plant_growth_timer(pos, elapsed, node_name) return true end - local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 12 - local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15 - --print ("---", MIN_LIGHT, MAX_LIGHT) + local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or farming.min_light + local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or farming.max_light if max_growth == 1 or lambda < 2.0 then @@ -628,6 +629,10 @@ farming.peas = 0.001 farming.beetroot = 0.001 farming.mint = 0.005 farming.cabbage = 0.001 +farming.blackberry = 0.002 +farming.soy = 0.001 +farming.vanilla = 0.001 +farming.lettuce = 0.001 farming.grains = true farming.rarety = 0.002 @@ -694,6 +699,10 @@ ddoo("chili.lua", farming.chili) ddoo("ryeoatrice.lua", farming.grains) ddoo("mint.lua", farming.mint) ddoo("cabbage.lua", farming.cabbage) +ddoo("blackberry.lua", farming.blackberry) +ddoo("soy.lua", farming.soy) +ddoo("vanilla.lua", farming.vanilla) +ddoo("lettuce.lua", farming.lettuce) dofile(farming.path .. "/food.lua") dofile(farming.path .. "/mapgen.lua") diff --git a/mods/farming/license.txt b/mods/farming/license.txt index 85848717..aa8a40ea 100644 --- a/mods/farming/license.txt +++ b/mods/farming/license.txt @@ -128,6 +128,7 @@ Created by TenPlus1 (CC BY 3.0) farming_rhubarb.png farming_rhubarb_pie.png farming_hemp*.png + farming_tofu*.png Created by ademant (CC-BY-3.0) farming_rye*.png @@ -142,3 +143,15 @@ Created by VanessaE and edited by SpaghettiToastBook (CC0): Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0): farming_barley.png + +Created by OgelGames (CC BY-SA 4.0) + farming_berry_smoothie.png + farming_cactus_juice.png + farming_salad.png + +Created by Felfa + farming_blackberry*.png + farming_lettuce*.png + farming_burger.png + farming_soy*.png + farming_vanilla*.png diff --git a/mods/farming/mapgen.lua b/mods/farming/mapgen.lua index ca7048df..94c43a7f 100644 --- a/mods/farming/mapgen.lua +++ b/mods/farming/mapgen.lua @@ -50,6 +50,12 @@ register_plant("beetroot_5", 1, 15, nil, "", -1, farming.beetroot) register_plant("mint_4", 1, 75, {"default:dirt_with_grass", "default:dirt_with_coniferous_litter"}, "group:water", 1, farming.mint) register_plant("cabbage_6", 2, 10, nil, "", -1, farming.cabbage) +register_plant("lettuce_5", 5, 30, nil, "", -1, farming.lettuce) +register_plant("blackberry_4", 3, 10, nil, "", -1, farming.blackberry) +register_plant("soy_6", 20, 50, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter", + "default:dry_dirt_with_dry_grass"}, "", -1, farming.soy) +register_plant("vanilla_7", 5, 35, nil, "", -1, farming.vanilla) if minetest.get_mapgen_setting("mg_name") == "v6" then @@ -124,7 +130,7 @@ minetest.register_decoration({ }, y_min = 5, y_max = 35, - decoration = {"farming:pepper_5"}, + decoration = {"farming:pepper_5", "farming:pepper_6", "farming:pepper_7"}, spawn_by = "group:tree", num_spawn_by = 1 }) diff --git a/mods/farming/textures/crops_pepper_plant_6.png b/mods/farming/textures/crops_pepper_plant_6.png new file mode 100644 index 00000000..f2de13ae Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_6.png differ diff --git a/mods/farming/textures/crops_pepper_plant_7.png b/mods/farming/textures/crops_pepper_plant_7.png new file mode 100644 index 00000000..b94526ba Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_7.png differ diff --git a/mods/farming/textures/crops_pepper_red.png b/mods/farming/textures/crops_pepper_red.png new file mode 100644 index 00000000..26802ec7 Binary files /dev/null and b/mods/farming/textures/crops_pepper_red.png differ diff --git a/mods/farming/textures/crops_pepper_yellow.png b/mods/farming/textures/crops_pepper_yellow.png new file mode 100644 index 00000000..c0273e43 Binary files /dev/null and b/mods/farming/textures/crops_pepper_yellow.png differ diff --git a/mods/farming/textures/farming_berry_smoothie.png b/mods/farming/textures/farming_berry_smoothie.png new file mode 100644 index 00000000..8da2fc55 Binary files /dev/null and b/mods/farming/textures/farming_berry_smoothie.png differ diff --git a/mods/farming/textures/farming_blackberry.png b/mods/farming/textures/farming_blackberry.png new file mode 100644 index 00000000..01d7ac5e Binary files /dev/null and b/mods/farming/textures/farming_blackberry.png differ diff --git a/mods/farming/textures/farming_blackberry_1.png b/mods/farming/textures/farming_blackberry_1.png new file mode 100644 index 00000000..8dd8832c Binary files /dev/null and b/mods/farming/textures/farming_blackberry_1.png differ diff --git a/mods/farming/textures/farming_blackberry_2.png b/mods/farming/textures/farming_blackberry_2.png new file mode 100644 index 00000000..7d3827c8 Binary files /dev/null and b/mods/farming/textures/farming_blackberry_2.png differ diff --git a/mods/farming/textures/farming_blackberry_3.png b/mods/farming/textures/farming_blackberry_3.png new file mode 100644 index 00000000..7d89aa0c Binary files /dev/null and b/mods/farming/textures/farming_blackberry_3.png differ diff --git a/mods/farming/textures/farming_blackberry_4.png b/mods/farming/textures/farming_blackberry_4.png new file mode 100644 index 00000000..d9d398d9 Binary files /dev/null and b/mods/farming/textures/farming_blackberry_4.png differ diff --git a/mods/farming/textures/farming_burger.png b/mods/farming/textures/farming_burger.png new file mode 100644 index 00000000..c39f7c0a Binary files /dev/null and b/mods/farming/textures/farming_burger.png differ diff --git a/mods/farming/textures/farming_lettuce.png b/mods/farming/textures/farming_lettuce.png new file mode 100644 index 00000000..3f29fbe4 Binary files /dev/null and b/mods/farming/textures/farming_lettuce.png differ diff --git a/mods/farming/textures/farming_lettuce_1.png b/mods/farming/textures/farming_lettuce_1.png new file mode 100644 index 00000000..39ce9830 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_1.png differ diff --git a/mods/farming/textures/farming_lettuce_2.png b/mods/farming/textures/farming_lettuce_2.png new file mode 100644 index 00000000..0e4ab303 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_2.png differ diff --git a/mods/farming/textures/farming_lettuce_3.png b/mods/farming/textures/farming_lettuce_3.png new file mode 100644 index 00000000..066833b7 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_3.png differ diff --git a/mods/farming/textures/farming_lettuce_4.png b/mods/farming/textures/farming_lettuce_4.png new file mode 100644 index 00000000..847a2de5 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_4.png differ diff --git a/mods/farming/textures/farming_lettuce_5.png b/mods/farming/textures/farming_lettuce_5.png new file mode 100644 index 00000000..97651f40 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_5.png differ diff --git a/mods/farming/textures/farming_salad.png b/mods/farming/textures/farming_salad.png new file mode 100644 index 00000000..febf40f3 Binary files /dev/null and b/mods/farming/textures/farming_salad.png differ diff --git a/mods/farming/textures/farming_soy_1.png b/mods/farming/textures/farming_soy_1.png new file mode 100644 index 00000000..9a64d873 Binary files /dev/null and b/mods/farming/textures/farming_soy_1.png differ diff --git a/mods/farming/textures/farming_soy_2.png b/mods/farming/textures/farming_soy_2.png new file mode 100644 index 00000000..e4915941 Binary files /dev/null and b/mods/farming/textures/farming_soy_2.png differ diff --git a/mods/farming/textures/farming_soy_3.png b/mods/farming/textures/farming_soy_3.png new file mode 100644 index 00000000..e8f39ee5 Binary files /dev/null and b/mods/farming/textures/farming_soy_3.png differ diff --git a/mods/farming/textures/farming_soy_4.png b/mods/farming/textures/farming_soy_4.png new file mode 100644 index 00000000..3012c2af Binary files /dev/null and b/mods/farming/textures/farming_soy_4.png differ diff --git a/mods/farming/textures/farming_soy_5.png b/mods/farming/textures/farming_soy_5.png new file mode 100644 index 00000000..63f0ce49 Binary files /dev/null and b/mods/farming/textures/farming_soy_5.png differ diff --git a/mods/farming/textures/farming_soy_6.png b/mods/farming/textures/farming_soy_6.png new file mode 100644 index 00000000..581def50 Binary files /dev/null and b/mods/farming/textures/farming_soy_6.png differ diff --git a/mods/farming/textures/farming_soy_7.png b/mods/farming/textures/farming_soy_7.png new file mode 100644 index 00000000..eb47e325 Binary files /dev/null and b/mods/farming/textures/farming_soy_7.png differ diff --git a/mods/farming/textures/farming_soy_beans.png b/mods/farming/textures/farming_soy_beans.png new file mode 100644 index 00000000..aedc04c9 Binary files /dev/null and b/mods/farming/textures/farming_soy_beans.png differ diff --git a/mods/farming/textures/farming_soy_milk_glass.png b/mods/farming/textures/farming_soy_milk_glass.png new file mode 100644 index 00000000..95c567dd Binary files /dev/null and b/mods/farming/textures/farming_soy_milk_glass.png differ diff --git a/mods/farming/textures/farming_soy_pod.png b/mods/farming/textures/farming_soy_pod.png new file mode 100644 index 00000000..eceeec53 Binary files /dev/null and b/mods/farming/textures/farming_soy_pod.png differ diff --git a/mods/farming/textures/farming_tofu.png b/mods/farming/textures/farming_tofu.png new file mode 100644 index 00000000..aaa0a2cf Binary files /dev/null and b/mods/farming/textures/farming_tofu.png differ diff --git a/mods/farming/textures/farming_tofu_cooked.png b/mods/farming/textures/farming_tofu_cooked.png new file mode 100644 index 00000000..23963cec Binary files /dev/null and b/mods/farming/textures/farming_tofu_cooked.png differ diff --git a/mods/farming/textures/farming_vanilla.png b/mods/farming/textures/farming_vanilla.png new file mode 100644 index 00000000..25596ade Binary files /dev/null and b/mods/farming/textures/farming_vanilla.png differ diff --git a/mods/farming/textures/farming_vanilla_1.png b/mods/farming/textures/farming_vanilla_1.png new file mode 100644 index 00000000..fdd10c04 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_1.png differ diff --git a/mods/farming/textures/farming_vanilla_2.png b/mods/farming/textures/farming_vanilla_2.png new file mode 100644 index 00000000..73ba2ca6 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_2.png differ diff --git a/mods/farming/textures/farming_vanilla_3.png b/mods/farming/textures/farming_vanilla_3.png new file mode 100644 index 00000000..596b9bfa Binary files /dev/null and b/mods/farming/textures/farming_vanilla_3.png differ diff --git a/mods/farming/textures/farming_vanilla_4.png b/mods/farming/textures/farming_vanilla_4.png new file mode 100644 index 00000000..55858275 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_4.png differ diff --git a/mods/farming/textures/farming_vanilla_5.png b/mods/farming/textures/farming_vanilla_5.png new file mode 100644 index 00000000..7ac3ef73 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_5.png differ diff --git a/mods/farming/textures/farming_vanilla_6.png b/mods/farming/textures/farming_vanilla_6.png new file mode 100644 index 00000000..10a5bfd0 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_6.png differ diff --git a/mods/farming/textures/farming_vanilla_7.png b/mods/farming/textures/farming_vanilla_7.png new file mode 100644 index 00000000..f2962ee6 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_7.png differ diff --git a/mods/farming/textures/farming_vanilla_8.png b/mods/farming/textures/farming_vanilla_8.png new file mode 100644 index 00000000..1801a976 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_8.png differ diff --git a/mods/farming/textures/farming_vanilla_extract.png b/mods/farming/textures/farming_vanilla_extract.png new file mode 100644 index 00000000..c0668cef Binary files /dev/null and b/mods/farming/textures/farming_vanilla_extract.png differ diff --git a/mods/homedecor_modpack/building_blocks/recipes.lua b/mods/homedecor_modpack/building_blocks/recipes.lua index b26cf44a..e0d601fc 100644 --- a/mods/homedecor_modpack/building_blocks/recipes.lua +++ b/mods/homedecor_modpack/building_blocks/recipes.lua @@ -41,7 +41,7 @@ minetest.register_craft({ minetest.register_craft({ output = 'building_blocks:fakegrass 2', recipe = { - {'default:leaves'}, + {'group:leaves'}, {"default:dirt"}, } }) @@ -139,7 +139,7 @@ minetest.register_craft({ minetest.register_craft({ output = 'building_blocks:woodglass 1', recipe = { - {"default:wood"}, + {"group:wood"}, {"default:glass"}, } }) diff --git a/mods/homedecor_modpack/homedecor_furniture/init.lua b/mods/homedecor_modpack/homedecor_furniture/init.lua index c1647ef9..5c317ddb 100644 --- a/mods/homedecor_modpack/homedecor_furniture/init.lua +++ b/mods/homedecor_modpack/homedecor_furniture/init.lua @@ -76,7 +76,7 @@ homedecor.register("wall_shelf", { minetest.register_craft({ output = "homedecor:table", recipe = { - { "default:wood","default:wood", "default:wood" }, + { "group:wood","group:wood", "group:wood" }, { "group:stick", "", "group:stick" }, }, }) diff --git a/mods/homedecor_modpack/homedecor_office/init.lua b/mods/homedecor_modpack/homedecor_office/init.lua index 137ed238..e55c4bcb 100644 --- a/mods/homedecor_modpack/homedecor_office/init.lua +++ b/mods/homedecor_modpack/homedecor_office/init.lua @@ -96,8 +96,8 @@ minetest.register_craft({ output = "homedecor:desk", recipe = { { "stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood" }, - { "homedecor:drawer_small", "default:wood", "default:wood" }, - { "homedecor:drawer_small", "", "default:wood" }, + { "homedecor:drawer_small", "group:wood", "group:wood" }, + { "homedecor:drawer_small", "", "group:wood" }, }, }) @@ -105,17 +105,17 @@ minetest.register_craft({ output = "homedecor:desk", recipe = { { "moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood" }, - { "homedecor:drawer_small", "default:wood", "default:wood" }, - { "homedecor:drawer_small", "", "default:wood" }, + { "homedecor:drawer_small", "group:wood", "group:wood" }, + { "homedecor:drawer_small", "", "group:wood" }, }, }) minetest.register_craft({ output = "homedecor:filing_cabinet", recipe = { - { "", "default:wood", "" }, - { "default:wood", "homedecor:drawer_small", "default:wood" }, - { "", "default:wood", "" }, + { "", "group:wood", "" }, + { "group:wood", "homedecor:drawer_small", "group:wood" }, + { "", "group:wood", "" }, }, }) diff --git a/mods/homedecor_modpack/homedecor_wardrobe/init.lua b/mods/homedecor_modpack/homedecor_wardrobe/init.lua index ebbfb0e6..c7d279c0 100644 --- a/mods/homedecor_modpack/homedecor_wardrobe/init.lua +++ b/mods/homedecor_modpack/homedecor_wardrobe/init.lua @@ -189,7 +189,7 @@ minetest.register_craft( { output = "homedecor:wardrobe", recipe = { { "homedecor:drawer_small", "homedecor:kitchen_cabinet" }, - { "homedecor:drawer_small", "default:wood" }, - { "homedecor:drawer_small", "default:wood" } + { "homedecor:drawer_small", "group:wood" }, + { "homedecor:drawer_small", "group:wood" } }, }) diff --git a/mods/mob_horse/init.lua b/mods/mob_horse/init.lua index 65d70fc9..422e9321 100644 --- a/mods/mob_horse/init.lua +++ b/mods/mob_horse/init.lua @@ -6,7 +6,7 @@ local S = minetest.get_translator and minetest.get_translator("mob_horse") or -- 0.4.17 or 5.0 check local y_off = 20 -if minetest.registered_nodes["default:permafrost"] then +if minetest.features.object_independent_selectionbox then y_off = 10 end @@ -104,6 +104,14 @@ mobs:register_mob("mob_horse:horse", { end, + do_punch = function(self, hitter) + + -- don't cut the branch you're... ah, that's not about that + if hitter ~= self.driver then + return true + end + end, + on_rightclick = function(self, clicker) -- make sure player is clicking @@ -121,8 +129,10 @@ mobs:register_mob("mob_horse:horse", { return end + local player_name = clicker:get_player_name() + -- make sure tamed horse is being clicked by owner only - if self.tamed and self.owner == clicker:get_player_name() then + if self.tamed and self.owner == player_name then local inv = clicker:get_inventory() local tool = clicker:get_wielded_item() @@ -184,13 +194,15 @@ mobs:register_mob("mob_horse:horse", { end -- show horse speed and jump stats with shoes fitted - minetest.chat_send_player(clicker:get_player_name(), + minetest.chat_send_player(player_name, S("Horse shoes fitted -") .. S(" speed: ") .. speed .. S(" , jump height: ") .. jump .. S(" , stop speed: ") .. reverse) - tool:take_item() ; clicker:set_wielded_item(tool) + tool:take_item() + + clicker:set_wielded_item(tool) return end diff --git a/mods/mobs_animal/sheep.lua b/mods/mobs_animal/sheep.lua index afc3742f..31daab13 100644 --- a/mods/mobs_animal/sheep.lua +++ b/mods/mobs_animal/sheep.lua @@ -64,6 +64,12 @@ for _, col in ipairs(all_colours) do stand_end = 80, walk_start = 81, walk_end = 100, + + die_start = 1, -- we dont have a specific death animation so we will + die_end = 2, -- re-use 2 standing frames at a speed of 1 fps and + die_speed = 1, -- have mob rotate when dying. + die_loop = false, + die_rotate = true, }, follow = { "farming:wheat", "default:grass_1", "farming:barley", @@ -97,7 +103,7 @@ for _, col in ipairs(all_colours) do --are we feeding? if mobs:feed_tame(self, clicker, 8, true, true) then - --if fed 7x grass or wheat then sheep regrows wool + --if fed 7 times then sheep regrows wool if self.food and self.food > 6 then self.gotten = false diff --git a/mods/mobs_redo/api.lua b/mods/mobs_redo/api.lua index 72947ab8..d2198509 100644 --- a/mods/mobs_redo/api.lua +++ b/mods/mobs_redo/api.lua @@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20201115", + version = "20201206", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -58,6 +58,7 @@ local mobs_drop_items = settings:get_bool("mobs_drop_items") ~= false local mobs_griefing = settings:get_bool("mobs_griefing") ~= false local spawn_protected = settings:get_bool("mobs_spawn_protected") ~= false local remove_far = settings:get_bool("remove_far_mobs") ~= false +local mob_area_spawn = settings:get_bool("mob_area_spawn") local difficulty = tonumber(settings:get("mob_difficulty")) or 1.0 local show_health = settings:get_bool("mob_show_health") ~= false local max_per_block = tonumber(settings:get("max_objects_per_block") or 99) @@ -111,6 +112,7 @@ local mob_class = { light_damage_max = 15, water_damage = 0, lava_damage = 0, + air_damage = 0, suffocation = 2, fall_damage = 1, fall_speed = -10, -- must be lower than -2 (default: -10) @@ -276,10 +278,10 @@ function mob_class:set_velocity(v) c_x, c_y = unpack(self:collision()) end - local yaw = (self.object:get_yaw() or 0) + self.rotate + local yaw = (self.object:get_yaw() or 0) + (self.rotate or 0) -- nil check for velocity - v = v or 0 + v = v or 0.01 -- check if standing in liquid with max viscosity of 7 local visc = min(minetest.registered_nodes[self.standing_in].liquid_viscosity, 7) @@ -291,8 +293,8 @@ function mob_class:set_velocity(v) v = v / (visc + 1) end - -- set velocity with hard limit of 10 - local vel = self.object:get_velocity() + -- set velocity + local vel = self.object:get_velocity() or 0 local new_vel = { x = (sin(yaw) * -v) + c_x, @@ -828,6 +830,11 @@ end -- check if mob is dead or only hurt function mob_class:check_for_death(cmi_cause) + -- We dead already + if self.state == "die" then + return true + end + -- has health actually changed? if self.health == self.old_health and self.health > 0 then return false @@ -898,6 +905,7 @@ function mob_class:check_for_death(cmi_cause) local frames = self.animation.die_end - self.animation.die_start local speed = self.animation.die_speed or 15 local length = max((frames / speed), 0) + local rot = self.animation.die_rotate and 5 self.attack = nil self.v_start = false @@ -905,6 +913,10 @@ function mob_class:check_for_death(cmi_cause) self.blinktimer = 0 self.passive = true self.state = "die" + self.object:set_properties({ + pointable = false, collide_with_objects = false, + automatic_rotate = rot, + }) self:set_velocity(0) self:set_animation("die") @@ -1089,6 +1101,19 @@ function mob_class:do_env_damage() end end + -- air damage + if self.air_damage ~= 0 and self.standing_in == "air" then + + self.health = self.health - self.air_damage + + effect(pos, 3, "bubble.png", 1, 1, 1, 0.2) + + if self:check_for_death({type = "environment", + pos = pos, node = self.standing_in}) then + return true + end + end + -- is mob light sensative, or scared of the dark :P if self.light_damage ~= 0 then @@ -1295,16 +1320,20 @@ function mob_class:follow_holding(clicker) return false end +-- Thanks Wuzzy for the following editable settings +local HORNY_TIME = 30 +local HORNY_AGAIN_TIME = 300 +local CHILD_GROW_TIME = 60 * 20 -- 20 minutes -- find two animals of same type and breed if nearby and horny function mob_class:breed() - -- child takes 240 seconds before growing into adult + -- child takes a long time before growing into adult if self.child == true then self.hornytimer = self.hornytimer + 1 - if self.hornytimer > 240 then + if self.hornytimer > CHILD_GROW_TIME then self.child = false self.hornytimer = 0 @@ -1333,14 +1362,14 @@ function mob_class:breed() return end - -- horny animal can mate for 40 seconds, - -- afterwards horny animal cannot mate again for 200 seconds + -- horny animal can mate for HORNY_TIME seconds, + -- afterwards horny animal cannot mate again for HORNY_AGAIN_TIME seconds if self.horny == true - and self.hornytimer < 240 then + and self.hornytimer < HORNY_TIME + HORNY_AGAIN_TIME then self.hornytimer = self.hornytimer + 1 - if self.hornytimer >= 240 then + if self.hornytimer >= HORNY_TIME + HORNY_AGAIN_TIME then self.hornytimer = 0 self.horny = false end @@ -1348,7 +1377,7 @@ function mob_class:breed() -- find another same animal who is also horny and mate if nearby if self.horny == true - and self.hornytimer <= 40 then + and self.hornytimer <= HORNY_TIME then local pos = self.object:get_pos() @@ -1356,7 +1385,6 @@ function mob_class:breed() "heart.png", 3, 4, 1, 0.1) local objs = minetest.get_objects_inside_radius(pos, 3) - local num = 0 local ent for n = 1, #objs do @@ -1385,18 +1413,20 @@ function mob_class:breed() end end - if ent + -- found another similar horny animal that isn't self? + if ent and ent.object ~= self.object and canmate == true and ent.horny == true - and ent.hornytimer <= 40 then - num = num + 1 - end + and ent.hornytimer <= HORNY_TIME then - -- found your mate? then have a baby - if num > 1 then + local pos2 = ent.object:get_pos() - self.hornytimer = 41 - ent.hornytimer = 41 + -- Have mobs face one another + yaw_to_pos(self, pos2) + yaw_to_pos(ent, self.object:get_pos()) + + self.hornytimer = HORNY_TIME + 1 + ent.hornytimer = HORNY_TIME + 1 -- have we reached active mob limit if active_limit > 0 and active_mobs >= active_limit then @@ -1464,8 +1494,6 @@ function mob_class:breed() ent2.owner = self.owner end, self, ent) - num = 0 - break end end @@ -2010,10 +2038,11 @@ function mob_class:follow_flop() self.following = nil end else - -- stop following player if not holding specific item + -- stop following player if not holding specific item or mob is horny if self.following and self.following:is_player() - and self:follow_holding(self.following) == false then + and (self:follow_holding(self.following) == false + or self.horny) then self.following = nil end @@ -2069,6 +2098,15 @@ function mob_class:follow_flop() if not self:attempt_flight_correction() then self.state = "flop" + + -- do we have a custom on_flop function? + if self.on_flop then + + if self:on_flop(self) then + return + end + end + self.object:set_velocity({x = 0, y = -5, z = 0}) self:set_animation("stand") @@ -3467,6 +3505,7 @@ minetest.register_entity(name, setmetatable({ owner = def.owner, order = def.order, on_die = def.on_die, + on_flop = def.on_flop, do_custom = def.do_custom, jump_height = def.jump_height, drawtype = def.drawtype, -- DEPRECATED, use rotate instead @@ -3490,6 +3529,7 @@ minetest.register_entity(name, setmetatable({ light_damage_max = def.light_damage_max, water_damage = def.water_damage, lava_damage = def.lava_damage, + air_damage = def.air_damage, suffocation = def.suffocation, fall_damage = def.fall_damage, fall_speed = def.fall_speed, @@ -3908,8 +3948,27 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter end end - -- returns position if we have enough space to spawn mob - pos = can_spawn(pos, name) + -- should we check mob area for obstructions ? + if mob_area_spawn ~= true then + + -- do we have enough height clearance to spawn mob? + local ent = minetest.registered_entities[name] + local height = max(1, math.ceil( + (ent.collisionbox[5] or 0.25) - (ent.collisionbox[2] or -0.25) - 1)) + + for n = 0, height do + + local pos2 = {x = pos.x, y = pos.y + n, z = pos.z} + + if minetest.registered_nodes[node_ok(pos2).name].walkable == true then +--print ("--- inside block", name, node_ok(pos2).name) + return + end + end + else + -- returns position if we have enough space to spawn mob + pos = can_spawn(pos, name) + end if pos then @@ -4552,8 +4611,11 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) -- make children grow quicker if self.child == true then - self.hornytimer = self.hornytimer + 20 - +-- self.hornytimer = self.hornytimer + 20 + -- deduct 10% of the time to adulthood + self.hornytimer = self.hornytimer + ( + (CHILD_GROW_TIME - self.hornytimer) * 0.1) +print ("====", self.hornytimer) return true end diff --git a/mods/mobs_redo/api.txt b/mods/mobs_redo/api.txt index e81b7503..70018915 100644 --- a/mods/mobs_redo/api.txt +++ b/mods/mobs_redo/api.txt @@ -64,6 +64,7 @@ functions needed for the mob to work properly which contains the following: 'fall_damage' when true causes falling to inflict damage. 'water_damage' holds the damage per second infliced to mobs when standing in water. + 'air_damage' holds damage per second inflicted to mob when standing in air. 'lava_damage' holds the damage per second inflicted to mobs when standing in lava or fire or an ignition source. 'light_damage' holds the damage per second inflicted to mobs when light @@ -226,6 +227,7 @@ functions needed for the mob to work properly which contains the following: 'die_end' 'die_speed' 'die_loop' when set to false stops the animation looping. + 'die_rotate' if true mob spins during death animation. Using '_loop = false' setting will stop any of the above animations from looping. @@ -298,6 +300,9 @@ enhance mob functionality and have them do many interesting things: is returned normal attack function continued. 'on_die' a function that is called when mob is killed (self, pos), also has access to self.cause_of_death table. + 'on_flop' function called when flying or swimmimng mob is no longer in + air/water, (self) paramater and return true to skip the built + in api flop feature. 'do_custom' a custom function that is called every tick while mob is active and which has access to all of the self.* variables e.g. (self.health for health or self.standing_in for node @@ -329,6 +334,14 @@ for each mob. 'self.order' set to "follow" or "stand" so that npc will follow owner or stand it's ground 'self.nametag' contains the name of the mob which it can show above + 'self.state' Current mob state. + "stand": no movement (except turning around) + "walk": walk or move around aimlessly + "attack": chase and attack enemy + "runaway": flee from target + "flop": bounce around aimlessly + (for swimming mobs that have stranded) + "die": during death Adding Mobs in World @@ -697,6 +710,9 @@ External Settings for "minetest.conf" function. 'mob_nospawn_range' Minimum range a mob can spawn near player (def: 12) 'mob_active_limit' Number of active mobs in game, 0 for unlimited + 'mob_area_spawn' When true will check surrounding area the size of the + mob for obstructions before spawning, otherwise it + defaults to checking the height of the mob only. Players can override the spawn chance for each mob registered by adding a line to their minetest.conf file with a new value, the lower the value the more each diff --git a/mods/mobs_redo/readme.MD b/mods/mobs_redo/readme.MD index 1960dc05..67cc12b9 100644 --- a/mods/mobs_redo/readme.MD +++ b/mods/mobs_redo/readme.MD @@ -23,6 +23,7 @@ Lucky Blocks: 9 Changelog: +- 1.54 - Simplified animal breeding function, added editable settings (thanks Wuzzy), Child mobs now take 20 mins to grow up, reverted to simple mob spawning with setting to use area checks, on_flop added, air_damage added. - 1.53 - Added 'on_map_load' settings to mobs:spawn so that mobs will only spawn when new areas of map are loaded. - 1.52 - Added 'mob_active_limit' in settings to set number of mobs in game, (default is 0 for unlimited), removed {immortal} from mob armor, fluid viscocity slows mobs diff --git a/mods/mobs_redo/settingtypes.txt b/mods/mobs_redo/settingtypes.txt index 75bf111b..49d24435 100644 --- a/mods/mobs_redo/settingtypes.txt +++ b/mods/mobs_redo/settingtypes.txt @@ -33,3 +33,6 @@ mob_nospawn_range (Mob no-spawn range) float 12.0 # Sets maximum number of active mobs in game (0 for unlimited) mob_active_limit (Mob Active Limit) float 0 + +# Enables area check when spawning mobs +mob_area_spawn (Mob Area Spawn) bool false diff --git a/mods/mobs_water/mobs_fish/init.lua b/mods/mobs_water/mobs_fish/init.lua index 697f8497..ede688ca 100644 --- a/mods/mobs_water/mobs_fish/init.lua +++ b/mods/mobs_water/mobs_fish/init.lua @@ -71,13 +71,28 @@ mobs:register_mob("mobs_fish:clownfish", { fall_speed = 0, view_range = 8, water_damage = 0, + air_damage = 1, lava_damage = 5, light_damage = 0, animation = l_anims, on_rightclick = function(self, clicker) mobs:capture_mob(self, clicker, l_cc_hand, l_cc_net, 0, true, "mobs_fish:clownfish") - end + end, + on_flop = function(self) + +-- print("=== am on land, help!", self.state) + + self.object:set_acceleration({ + x = math.random(-0.1, 0.1), + y = -10, + z = math.random(-0.1, 0.1) + }) + + self.object:set_velocity({x = 0, y = -10, z = 0}) + + return true + end, }) mobs:spawn({ @@ -116,11 +131,26 @@ mobs:register_mob("mobs_fish:tropical", { water_damage = 0, lava_damage = 5, light_damage = 0, + air_damage = 1, animation = l_anims, on_rightclick = function(self, clicker) mobs:capture_mob(self, clicker, l_cc_hand, l_cc_net, 0, true, "mobs_fish:tropical") - end + end, + on_flop = function(self) + +-- print("=== am on land, help!", self.state) + + self.object:set_acceleration({ + x = math.random(-0.1, 0.1), + y = -10, + z = math.random(-0.1, 0.1) + }) + + self.object:set_velocity({x = 0, y = -10, z = 0}) + + return true + end, }) mobs:spawn({ diff --git a/mods/moreblocks/CHANGELOG.md b/mods/moreblocks/CHANGELOG.md index b50f6d69..af7f67ad 100644 --- a/mods/moreblocks/CHANGELOG.md +++ b/mods/moreblocks/CHANGELOG.md @@ -7,20 +7,33 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [2.1.0] - 2020-12-14 + +### Added + +- Clean Glass versions of Trap and (Super) Glowing Glass. +- Compressed desert cobblestone. + +### Changed + +- Revised placing strategy that takes into account which side of the face + (top/bottom for horizontal, left/right for vertical placement) is being clicked. + Aux (sprint/special, default E) key can be used to place the node with the orientation + it would have if placed from the other side. + When placing nodes next to nodes of the same gategory (e.g.slab to slab) the other + node's orientation is copied, flipping it placing on top or below an upright or + upside-down node. In this case the aux key will disable the special processing of + same-category nodes. + +### Fixed + +- Revised minetest_game crafting recipe overrides to match Minetest 5.0.0 and later. + ### Removed - Legacy Stairs+ conversion code. - It was only required to import worlds last edited before Q3 2013. -### Changed - -- Switch to GitHub Actions. - - Benefits include faster responses. - -### Added - -- Compressed desert cobblestone. - ## [2.0.0] - 2019-11-25 ### Added @@ -104,7 +117,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Initial versioned release. -[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v2.0.0...HEAD +[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v2.1.0...HEAD +[2.1.0]: https://github.com/minetest-mods/moreblocks/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/minetest-mods/moreblocks/compare/v1.3.0...v2.0.0 [1.3.0]: https://github.com/minetest-mods/moreblocks/compare/v1.2.0...v1.3.0 [1.2.0]: https://github.com/minetest-mods/moreblocks/compare/v1.1.0...v1.2.0 diff --git a/mods/moreblocks/README.md b/mods/moreblocks/README.md index 38a1dd4a..2d5d575e 100644 --- a/mods/moreblocks/README.md +++ b/mods/moreblocks/README.md @@ -58,7 +58,7 @@ on that line. ## Version compatibility -More Blocks is currently primarily tested with Minetest 5.1.0. +More Blocks is currently primarily tested with Minetest 5.3.0. It may or may not work with newer or older versions. Issues arising in older versions than 5.0.0 will generally not be fixed. diff --git a/mods/moreblocks/crafting.lua b/mods/moreblocks/crafting.lua index cd07711c..34d1dc04 100644 --- a/mods/moreblocks/crafting.lua +++ b/mods/moreblocks/crafting.lua @@ -348,12 +348,36 @@ minetest.register_craft({ recipe = {"moreblocks:sweeper", "default:glass"}, }) +minetest.register_craft({ + output = "moreblocks:trap_clean_glass", + type = "shapeless", + recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glass"}, +}) + +minetest.register_craft({ + output = "moreblocks:trap_clean_glass", + type = "shapeless", + recipe = {"moreblocks:sweeper", "moreblocks:trap_glass"}, +}) + minetest.register_craft({ output = "moreblocks:glow_glass", type = "shapeless", recipe = {"default:torch", "default:glass"}, }) +minetest.register_craft({ + output = "moreblocks:clean_glow_glass", + type = "shapeless", + recipe = {"default:torch", "moreblocks:clean_glass"}, +}) + +minetest.register_craft({ + output = "moreblocks:clean_glow_glass", + type = "shapeless", + recipe = {"moreblocks:sweeper", "moreblocks:glow_glass"}, +}) + minetest.register_craft({ output = "moreblocks:trap_glow_glass", type = "shapeless", @@ -366,6 +390,26 @@ minetest.register_craft({ recipe = {"default:mese_crystal_fragment", "moreblocks:glow_glass"}, }) +-- several recipes are possible for the trap+clean+glow, we only present 3 of them +minetest.register_craft({ + output = "moreblocks:trap_clean_glow_glass", + type = "shapeless", + recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glow_glass"}, +}) + +minetest.register_craft({ + output = "moreblocks:trap_clean_glow_glass", + type = "shapeless", + recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glass", "default:torch"}, +}) + +minetest.register_craft({ + output = "moreblocks:trap_clean_glow_glass", + type = "shapeless", + recipe = {"moreblocks:sweeper", "moreblocks:trap_glow_glass" }, +}) + + minetest.register_craft({ output = "moreblocks:super_glow_glass", type = "shapeless", @@ -378,6 +422,24 @@ minetest.register_craft({ recipe = {"default:torch", "moreblocks:glow_glass"}, }) +minetest.register_craft({ + output = "moreblocks:clean_super_glow_glass", + type = "shapeless", + recipe = {"default:torch", "default:torch", "moreblocks:clean_glass"}, +}) + +minetest.register_craft({ + output = "moreblocks:clean_super_glow_glass", + type = "shapeless", + recipe = {"default:torch", "moreblocks:clean_glow_glass"}, +}) + +minetest.register_craft({ + output = "moreblocks:clean_super_glow_glass", + type = "shapeless", + recipe = {"moreblocks:sweeper", "moreblocks:super_glow_glass"}, +}) + minetest.register_craft({ output = "moreblocks:trap_super_glow_glass", @@ -391,6 +453,32 @@ minetest.register_craft({ recipe = {"default:mese_crystal_fragment", "moreblocks:super_glow_glass"}, }) +-- several recipes are possible for the trap+clean+glow, we only present 4 of them +minetest.register_craft({ + output = "moreblocks:trap_clean_super_glow_glass", + type = "shapeless", + recipe = {"default:mese_crystal_fragment", "moreblocks:clean_super_glow_glass"}, +}) + +minetest.register_craft({ + output = "moreblocks:trap_clean_super_glow_glass", + type = "shapeless", + recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glow_glass", "default:torch"}, +}) + +minetest.register_craft({ + output = "moreblocks:trap_clean_super_glow_glass", + type = "shapeless", + recipe = {"default:mese_crystal_fragment", "moreblocks:clean_glass", "default:torch", "default:torch"}, +}) + +minetest.register_craft({ + output = "moreblocks:trap_clean_super_glow_glass", + type = "shapeless", + recipe = {"moreblocks:sweeper", "moreblocks:trap_super_glow_glass" }, +}) + + minetest.register_craft({ output = "moreblocks:coal_stone", type = "shapeless", diff --git a/mods/moreblocks/nodes.lua b/mods/moreblocks/nodes.lua index e255e0ad..79abcb57 100644 --- a/mods/moreblocks/nodes.lua +++ b/mods/moreblocks/nodes.lua @@ -349,6 +349,19 @@ local nodes = { sounds = sound_stone, no_stairs = true, }, + ["trap_clean_glass"] = { + description = S("Trap Clean Glass"), + drawtype = "glasslike_framed_optional", + tiles = {"moreblocks_clean_glass.png^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png"}, + use_texture_alpha = true, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = sound_glass, + no_stairs = true, + }, ["trap_sandstone"] = { description = S("Trap Sandstone"), drawtype = "glasslike_framed", @@ -407,6 +420,18 @@ local nodes = { groups = {cracky = 3, oddly_breakable_by_hand = 3}, sounds = sound_glass, }, + ["clean_glow_glass"] = { + description = S("Clean Glow Glass"), + drawtype = "glasslike_framed_optional", + tiles = {"moreblocks_clean_glass.png^[colorize:#E9CD61", "moreblocks_clean_glass_detail.png^[colorize:#E9CD61"}, + use_texture_alpha = true, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + light_source = 11, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = sound_glass, + }, ["trap_glow_glass"] = { description = S("Trap Glow Glass"), drawtype = "glasslike_framed_optional", @@ -421,6 +446,20 @@ local nodes = { sounds = sound_glass, no_stairs = true, }, + ["trap_clean_glow_glass"] = { + description = S("Trap Clean Glow Glass"), + drawtype = "glasslike_framed_optional", + tiles = {"moreblocks_clean_glass.png^[colorize:#E9CD61^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png^[colorize:#E9CD61"}, + use_texture_alpha = true, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + light_source = 11, + walkable = false, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = sound_glass, + no_stairs = true, + }, ["super_glow_glass"] = { description = S("Super Glow Glass"), drawtype = "glasslike_framed_optional", @@ -433,6 +472,18 @@ local nodes = { groups = {cracky = 3, oddly_breakable_by_hand = 3}, sounds = sound_glass, }, + ["clean_super_glow_glass"] = { + description = S("Clean Super Glow Glass"), + drawtype = "glasslike_framed_optional", + tiles = {"moreblocks_clean_glass.png^[colorize:#FFFF78", "moreblocks_clean_glass_detail.png^[colorize:#FFFF78"}, + use_texture_alpha = true, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + light_source = default.LIGHT_MAX, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = sound_glass, + }, ["trap_super_glow_glass"] = { description = S("Trap Super Glow Glass"), drawtype = "glasslike_framed_optional", @@ -447,6 +498,20 @@ local nodes = { sounds = sound_glass, no_stairs = true, }, + ["trap_clean_super_glow_glass"] = { + description = S("Trap Clean Super Glow Glass"), + drawtype = "glasslike_framed_optional", + tiles = {"moreblocks_clean_glass.png^[colorize:#FFFF78^moreblocks_trap_box_glass.png", "moreblocks_clean_glass_detail.png^[colorize:#FFFF78"}, + use_texture_alpha = true, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + light_source = default.LIGHT_MAX, + walkable = false, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = sound_glass, + no_stairs = true, + }, ["rope"] = { description = S("Rope"), drawtype = "signlike", diff --git a/mods/moreblocks/redefinitions.lua b/mods/moreblocks/redefinitions.lua index 6cb8ea43..1856c989 100644 --- a/mods/moreblocks/redefinitions.lua +++ b/mods/moreblocks/redefinitions.lua @@ -7,24 +7,42 @@ Licensed under the zlib license. See LICENSE.md for more information. -- Redefinitions of some default crafting recipes: -minetest.register_craft({ - output = "default:sign_wall 4", +-- Signs: +1 +minetest.clear_craft({ recipe = { - {"default:wood", "default:wood", "default:wood"}, - {"default:wood", "default:wood", "default:wood"}, - {"", "default:stick", ""}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', 'group:stick', ''}, + } +}) + +minetest.clear_craft({ + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'', 'group:stick', ''}, } }) minetest.register_craft({ - output = "default:ladder 4", + output = 'default:sign_wall_steel 4', recipe = { - {"default:stick", "", "default:stick"}, - {"default:stick", "default:stick", "default:stick"}, - {"default:stick", "", "default:stick"}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', 'group:stick', ''}, } }) +minetest.register_craft({ + output = 'default:sign_wall_wood 4', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'', 'group:stick', ''}, + } +}) + + minetest.clear_craft({ recipe = { {"default:papyrus", "default:papyrus", "default:papyrus"} @@ -37,6 +55,7 @@ minetest.register_craft({ } }) + minetest.register_craft({ output = "default:rail 24", recipe = { diff --git a/mods/moreblocks/stairsplus/common.lua b/mods/moreblocks/stairsplus/common.lua index de852caf..15e86520 100644 --- a/mods/moreblocks/stairsplus/common.lua +++ b/mods/moreblocks/stairsplus/common.lua @@ -15,6 +15,97 @@ local descriptions = { ["stair"] = S("%s Stairs"), } +-- Extends the standad rotate_node placement so that it takes into account +-- the side (top/bottom or left/right) of the face being pointed at. +-- As with the standard rotate_node, sneak can be used to force the perpendicular +-- placement (wall placement on floor/ceiling, floor/ceiling placement on walls). +-- Additionally, the aux / sprint / special key can be used to place the node +-- as if from the opposite side. +-- +-- When placing a node next to one of the same category (e.g. slab to slab or +-- stair to stair), the default placement (regardless of sneak) is to copy the +-- under node's param2, flipping if placed above or below it. The aux key disable +-- this behavior. +local wall_right_dirmap = {9, 18, 7, 12} +local wall_left_dirmap = {11, 16, 5, 14} +local ceil_dirmap = {20, 23, 22, 21} + +stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing) + local sneak = placer and placer:get_player_control().sneak + local aux = placer and placer:get_player_control().aux1 + + -- namestring for what we are placing, up to the first _ (exclusive) + local item_prefix = itemstack:get_name():gsub("_.*$", "") + -- namestring for what we are placing against + local under = pointed_thing.under + local under_node = minetest.get_node(under) + local under_prefix = under_node and under_node.name:gsub("_.*$", "") + + local same_cat = item_prefix == under_prefix + + -- standard (floor) facedir, also used for sneak placement against the lower half of the wall + local p2 = placer and minetest.dir_to_facedir(placer:get_look_dir()) or 0 + + -- check which face and which quadrant we are interested in + -- this is used both to check if we're handling parallel placement in the same-category case, + -- and in general for sneak placement + local face_pos = minetest.pointed_thing_to_face_pos(placer, pointed_thing) + local face_off = vector.subtract(face_pos, under) + local wallmounted = minetest.dir_to_wallmounted(face_off) + + if same_cat and not aux then + p2 = under_node.param2 + -- flip if placing above or below an upright or upside-down node + -- TODO should we also flip when placing next to a side-mounted node? + if wallmounted < 2 then + if p2 < 4 then + p2 = (p2 + 2) % 4 + p2 = ceil_dirmap[p2 + 1] + elseif p2 > 19 then + p2 = ceil_dirmap[p2 - 19] - 20 + p2 = (p2 + 2) % 4 + end + end + else + -- for same-cat placement, aux is used to disable param2 copying + if same_cat then + aux = not aux + end + + local remap = nil + + -- standard placement against the wall + local use_wallmap = (wallmounted > 1 and not sneak) or (wallmounted < 2 and sneak) + + -- standard placement against the ceiling, or sneak placement against the upper half of the wall + local use_ceilmap = wallmounted == 1 and not sneak + use_ceilmap = use_ceilmap or (wallmounted > 1 and sneak and face_off.y > 0) + + if use_wallmap then + local left = (p2 == 0 and face_off.x < 0) or + (p2 == 1 and face_off.z > 0) or + (p2 == 2 and face_off.x > 0) or + (p2 == 3 and face_off.z < 0) + if aux then + left = not left + end + remap = left and wall_left_dirmap or wall_right_dirmap + elseif use_ceilmap then + remap = ceil_dirmap + end + + if aux then + p2 = (p2 + 2) % 4 + end + + if remap then + p2 = remap[p2 + 1] + end + end + + return minetest.item_place(itemstack, placer, pointed_thing, p2) +end + stairsplus.register_single = function(category, alternate, info, modname, subname, recipeitem, fields) local src_def = minetest.registered_nodes[recipeitem] or {} local desc_base = descriptions[category]:format(fields.description) @@ -42,7 +133,7 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam -- Darken light sources slightly to make up for their smaller visual size def.light_source = math.max(0, (def.light_source or 0) - 1) - def.on_place = minetest.rotate_node + def.on_place = stairsplus.rotate_node_aux def.groups = stairsplus:prepare_groups(fields.groups) if category == "slab" then diff --git a/mods/plantlife_modpack/trunks/nodes.lua b/mods/plantlife_modpack/trunks/nodes.lua index c8199b68..f60281bd 100644 --- a/mods/plantlife_modpack/trunks/nodes.lua +++ b/mods/plantlife_modpack/trunks/nodes.lua @@ -42,6 +42,14 @@ for i in pairs(NoDe) do liquids_pointable = true, on_place = function(itemstack, placer, pointed_thing) local pt = pointed_thing + + if not placer then return end + local playername = placer:get_player_name() + if minetest.is_protected(pt.above, playername) then + minetest.record_protection_violation(pt.above, playername) + return + end + local direction = minetest.dir_to_facedir(placer:get_look_dir()) if minetest.get_node(pt.above).name=="air" then minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction}) diff --git a/mods/protector/locale/protector.ru.tr b/mods/protector/locale/protector.ru.tr index 1784d6d0..fc6068e9 100644 --- a/mods/protector/locale/protector.ru.tr +++ b/mods/protector/locale/protector.ru.tr @@ -8,48 +8,48 @@ Remove Protectors around players (separate names with spaces)=Удалить з Replace Protector Owner with name provided=Заменить владельца защиты новым владельцем =<имя владельца> <имя нового владельца> Replacing Protector name '@1' with '@2'=Заменяется владелец защиты с '@1' на '@2' -Show protected areas of your nearby protectors=Показать защищенные территории с ближней защитой -Protector Names to remove: @1=Имена защит, подлежащих удалению: @1 -Name List Reset=Сброс списка имен +Show protected areas of your nearby protectors=Показать ближайшие защищённые территории +Protector Names to remove: @1=Имена, подлежащие удалению: @1 +Name List Reset=Очистить список имён ### doors_chest.lua ### -Protected Wooden Door=Защищенная яблоневая дверь -Protected Steel Door=Защищенная стальная дверь -Protected Trapdoor=Защищенный яблоневый люк -Protected Steel Trapdoor=Защищенный стальной люк -Protected Chest=Защищенный сундук +Protected Wooden Door=Защищённая яблоневая дверь +Protected Steel Door=Защищённая стальная дверь +Protected Trapdoor=Защищённый яблоневый люк +Protected Steel Trapdoor=Защищённый стальной люк +Protected Chest=Защищённый сундук To Chest=В сундук To Inventory=В инвентрарь -Protected Chest (@1)=Защищенный сундук (@1) +Protected Chest (@1)=Защищённый сундук (@1) ### init.lua ### -- Protector interface --=-- Настройка защиты -- -PUNCH node to show protected area=СТУКНУТЬ узел для подсведки защищенной территории -USE for area check=ЛКМ для проверки защищенной территории +PUNCH node to show protected area=СТУКНУТЬ узел для подсветки защищённой территории +USE for area check=ЛКМ для проверки защищённой территории Members:=Участники: Close=Закрыть Protection located at: @1=Защита находится на координатах @1 Members: @1.=Участники: @1. This area is not protected.=Территория свободна. -You can build here.=Здесь можно ставить блоки." -Overlaps into above players protected area=Защитный блок не может быть установлен: пересечение с областями, защищенными другими игроками +You can build here.=Здесь можно ставить блоки. +Overlaps into above players protected area=Защитный блок не может быть установлен: пересечение с областями, защищёнными другими игроками Protection Block=Защитный блок Protection (owned by @1)=Защита игрока @1 Protection Logo=Защитный знак -[MOD] Protector Redo loaded=[MOD] Модификация \"Переделанная Защита\" загружена -Spawn @1 has been protected up to a @2 block radius.=Спаун @1 защищен в радиусе @2 блока. +[MOD] Protector Redo loaded=[МОД] Protector Redo загружен +Spawn @1 has been protected up to a @2 block radius.=Спаун @1 защищён в радиусе @2 блока. This area is owned by @1=Эта территория пренадлежит @1 ### pvp.lua ### [Protector] on_punchplayer called with nil objects=[Защита] on_punchplayer вызвана с нулевыми объектами -[Protector] pvp_protect not active, update your version of Minetest=[Защита] pvp_protect не активен, обновите версию Minetest -[Protector] pvp_protect is disabled=[Защита] pvp_protect отключен +[Protector] pvp_protect not active, update your version of Minetest=[Защита] pvp_protect неактивен, обновите версию Minetest +[Protector] pvp_protect is disabled=[Защита] pvp_protect отключён ### hud.lua ### Owner: @1=Владелец: @1 ### tool.lua ### -Protector Placer Tool (stand near protector, face direction and use)=Инструмент установки защиты (станьте рядом с защитой, повернитесь в нужное направление и используйте) +Protector Placer Tool (stand near protector, face direction and use)=Инструмент установки защиты (встаньте рядом с защитой, повернитесь в нужном направлении и используйте) Protector already in place!=Защита уже установлена! No protectors available to place!=У вас нет защитных блоков в инвентаре! Protector placed at @1=Защита находится на координатах @1 diff --git a/mods/skinsdb/meta/character_1931.txt b/mods/skinsdb/meta/character_1931.txt new file mode 100644 index 00000000..37f5f33e --- /dev/null +++ b/mods/skinsdb/meta/character_1931.txt @@ -0,0 +1,3 @@ +Majo +TMSB aka Dragoni or Dragon-ManioNM +CC BY-SA 4.0 diff --git a/mods/skinsdb/meta/character_1932.txt b/mods/skinsdb/meta/character_1932.txt new file mode 100644 index 00000000..571e679f --- /dev/null +++ b/mods/skinsdb/meta/character_1932.txt @@ -0,0 +1,3 @@ +player1234's skin(dont use) +player1234 +CC BY-NC-SA 3.0 diff --git a/mods/skinsdb/meta/character_1933.txt b/mods/skinsdb/meta/character_1933.txt new file mode 100644 index 00000000..80037d59 --- /dev/null +++ b/mods/skinsdb/meta/character_1933.txt @@ -0,0 +1,3 @@ +ElCeejus, Father of Dragons +ElCeejo +CC BY-SA 3.0 diff --git a/mods/skinsdb/meta/character_1934.txt b/mods/skinsdb/meta/character_1934.txt new file mode 100644 index 00000000..ef753b0a --- /dev/null +++ b/mods/skinsdb/meta/character_1934.txt @@ -0,0 +1,3 @@ +Bald Man +El_Naso +CC BY-SA 4.0 diff --git a/mods/skinsdb/meta/character_1935.txt b/mods/skinsdb/meta/character_1935.txt new file mode 100644 index 00000000..278c31ab --- /dev/null +++ b/mods/skinsdb/meta/character_1935.txt @@ -0,0 +1,3 @@ +annotatemyfaith +annotatemyfaith +CC BY-SA 3.0 diff --git a/mods/skinsdb/textures/character_1931.png b/mods/skinsdb/textures/character_1931.png new file mode 100644 index 00000000..b02bdb1e Binary files /dev/null and b/mods/skinsdb/textures/character_1931.png differ diff --git a/mods/skinsdb/textures/character_1932.png b/mods/skinsdb/textures/character_1932.png new file mode 100644 index 00000000..f8efd6a5 Binary files /dev/null and b/mods/skinsdb/textures/character_1932.png differ diff --git a/mods/skinsdb/textures/character_1933.png b/mods/skinsdb/textures/character_1933.png new file mode 100644 index 00000000..3eeb9ee1 Binary files /dev/null and b/mods/skinsdb/textures/character_1933.png differ diff --git a/mods/skinsdb/textures/character_1934.png b/mods/skinsdb/textures/character_1934.png new file mode 100644 index 00000000..59cbe272 Binary files /dev/null and b/mods/skinsdb/textures/character_1934.png differ diff --git a/mods/skinsdb/textures/character_1935.png b/mods/skinsdb/textures/character_1935.png new file mode 100644 index 00000000..c124fff0 Binary files /dev/null and b/mods/skinsdb/textures/character_1935.png differ diff --git a/mods/techpack/tubelib/tubes.lua b/mods/techpack/tubelib/tubes.lua index d467fde7..14e3cf8d 100644 --- a/mods/techpack/tubelib/tubes.lua +++ b/mods/techpack/tubelib/tubes.lua @@ -35,6 +35,15 @@ local Tube = tubelib2.Tube:new({ tubelib.Tube = Tube +local function ON_BLAST(id) + return function (pos) + local node = minetest.get_node(pos) + minetest.remove_node(pos) + Tube:after_dig_tube(pos, node) + return {id} + end +end + minetest.register_node("tubelib:tubeS", { description = S("Tubelib Tube"), tiles = { -- Top, base, right, left, front, back @@ -80,6 +89,7 @@ minetest.register_node("tubelib:tubeS", { is_ground_content = false, groups = {choppy=2, cracky=3}, sounds = default.node_sound_wood_defaults(), + on_blast = ON_BLAST("tubelib:tubeS"), }) minetest.register_node("tubelib:tubeA", { @@ -121,6 +131,7 @@ minetest.register_node("tubelib:tubeA", { groups = {choppy=2, cracky=3, not_in_creative_inventory=1}, sounds = default.node_sound_wood_defaults(), drop = "tubelib:tubeS", + on_blast = ON_BLAST("tubelib:tubeA"), }) minetest.register_craft({ diff --git a/mods/techpack/tubelib_addons1/fermenter.lua b/mods/techpack/tubelib_addons1/fermenter.lua index 05236f7e..27f849ba 100644 --- a/mods/techpack/tubelib_addons1/fermenter.lua +++ b/mods/techpack/tubelib_addons1/fermenter.lua @@ -342,8 +342,13 @@ if minetest.global_exists("unified_inventory") then width = 2, height = 2, }) + + local leaves_table = {} + for i = 1, NUM_LEAVES do + table.insert(leaves_table, "group:leaves") + end unified_inventory.register_craft({ - items = {"group:leaves", "group:leaves"}, + items = leaves_table, output = "tubelib_addons1:biogas", type = "fermenting" }) diff --git a/mods/techpack/tubelib_addons1/harvester.lua b/mods/techpack/tubelib_addons1/harvester.lua index a5852344..4c98b9d3 100644 --- a/mods/techpack/tubelib_addons1/harvester.lua +++ b/mods/techpack/tubelib_addons1/harvester.lua @@ -119,7 +119,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) local inv = M(pos):get_inventory() if listname == "main" then return stack:get_count() - elseif listname == "fuel" and stack:get_name() == "tubelib_addons1:biofuel" then + elseif listname == "fuel" and tubelib.is_fuel(stack) then return stack:get_count() end return 0 @@ -147,6 +147,16 @@ local function remove_all_sapling_items(pos) end end +local function is_plantable_ground(node) + if minetest.get_item_group(node.name, "soil") ~= 0 then + return true + end + if minetest.get_item_group(node.name, "sand") ~= 0 then + return true + end + return false +end + -- Remove wood/leave nodes and place sapling if necessary -- Return false if inventory is full -- else return true @@ -163,7 +173,7 @@ local function remove_or_replace_node(this, pos, inv, node, order) minetest.remove_node(pos) inv:add_item("main", ItemStack(order.drop)) this.num_items = this.num_items + 1 - if tubelib_addons1.GroundNodes[next_node.name] ~= nil and order.plant then -- hit the ground? + if is_plantable_ground(next_node) and order.plant then -- hit the ground? minetest.set_node(pos, {name=order.plant, paramtype2 = "wallmounted", param2=1}) if order.t1 ~= nil then -- We have to simulate "on_place" and start the timer by hand @@ -180,7 +190,12 @@ end -- check the fuel level and return false if empty local function check_fuel(pos, this, meta) if this.fuel <= 0 then - if tubelib.get_this_item(meta, "fuel", 1) == nil then + local fuel_item = tubelib.get_this_item(meta, "fuel", 1) + if fuel_item == nil then + return false + end + if not tubelib.is_fuel(fuel_item) then + tubelib.put_item(meta, "fuel", fuel_item) return false end this.fuel = BURNING_TIME @@ -222,7 +237,7 @@ local function harvest_field(this, meta) if node and node.name ~= "air" then local order = tubelib_addons1.FarmingNodes[node.name] or tubelib_addons1.Flowers[node.name] if order then - if not remove_or_replace_node(this, pos, inv, node, order) then + if not minetest.is_protected(pos, this.owner) and not remove_or_replace_node(this, pos, inv, node, order) then return false end else @@ -433,6 +448,9 @@ tubelib.register_node("tubelib_addons1:harvester_base", {"tubelib_addons1:harves return tubelib.get_item(M(pos), "main") end, on_push_item = function(pos, side, item) + if not tubelib.is_fuel(item) then + return false + end return tubelib.put_item(M(pos), "fuel", item) end, on_unpull_item = function(pos, side, item) diff --git a/mods/techpack/tubelib_addons1/quarry.lua b/mods/techpack/tubelib_addons1/quarry.lua index ea7ac9c7..75c26d9f 100644 --- a/mods/techpack/tubelib_addons1/quarry.lua +++ b/mods/techpack/tubelib_addons1/quarry.lua @@ -122,7 +122,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) local inv = M(pos):get_inventory() if listname == "main" then return stack:get_count() - elseif listname == "fuel" and stack:get_name() == "tubelib_addons1:biofuel" then + elseif listname == "fuel" and tubelib.is_fuel(stack) then return stack:get_count() end return 0 @@ -164,10 +164,16 @@ local function quarry_next_node(pos, meta) -- check fuel local fuel = meta:get_int("fuel") or 0 if fuel <= 0 then - if tubelib.get_this_item(meta, "fuel", 1) == nil then + local fuel_item = tubelib.get_this_item(meta, "fuel", 1) + if fuel_item == nil then State:fault(pos, meta) return end + if not tubelib.is_fuel(fuel_item) then + State:fault(pos, meta) + tubelib.put_item(meta, "fuel", fuel_item) + return + end fuel = BURNING_TIME else fuel = fuel - 1 @@ -215,7 +221,8 @@ local function quarry_next_node(pos, meta) meta:set_string("quarry_pos", P2S(quarry_pos)) if minetest.is_protected(quarry_pos, owner) then - minetest.chat_send_player(owner, S("[Tubelib Quarry] Area is protected!")) + minetest.chat_send_player(owner, S("[Tubelib Quarry] Area is protected!") .. + " " .. minetest.pos_to_string(quarry_pos) ) State:fault(pos, meta) return end @@ -442,6 +449,9 @@ tubelib.register_node("tubelib_addons1:quarry", return tubelib.get_item(M(pos), "main") end, on_push_item = function(pos, side, item) + if not tubelib.is_fuel(item) then + return false + end return tubelib.put_item(M(pos), "fuel", item) end, on_unpull_item = function(pos, side, item) diff --git a/mods/techpack/tubelib_addons1/reformer.lua b/mods/techpack/tubelib_addons1/reformer.lua index 3803251f..90e37711 100644 --- a/mods/techpack/tubelib_addons1/reformer.lua +++ b/mods/techpack/tubelib_addons1/reformer.lua @@ -342,6 +342,9 @@ minetest.register_craft({ }, }) +function tubelib.is_fuel(stack) + return stack:get_name() == "tubelib_addons1:biofuel" +end tubelib.register_node("tubelib_addons1:reformer", {"tubelib_addons1:reformer_defect"}, { on_pull_item = function(pos, side) diff --git a/mods/tubelib2/tube_api.lua b/mods/tubelib2/tube_api.lua index 8a78ba93..5c3d6903 100644 --- a/mods/tubelib2/tube_api.lua +++ b/mods/tubelib2/tube_api.lua @@ -58,7 +58,7 @@ function tubelib2.get_node_lvm(pos) local data = vm:get_data() local param2_data = vm:get_param2_data() local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge}) - local idx = area:index(pos.x, pos.y, pos.z) + local idx = area:indexp(pos) node = { name = minetest.get_name_from_content_id(data[idx]), param2 = param2_data[idx] diff --git a/mods/unifieddyes/init.lua b/mods/unifieddyes/init.lua index 365a3363..fa1f733b 100644 --- a/mods/unifieddyes/init.lua +++ b/mods/unifieddyes/init.lua @@ -166,14 +166,11 @@ minetest.register_on_placenode( return false end + local param2 if not string.find(itemstack:to_string(), "palette_index") then - local param2 - local color = 0 - if def.palette == "unifieddyes_palette_extended.png" and def.paramtype2 == "color" then param2 = 240 - color = 240 elseif def.palette == "unifieddyes_palette_colorwallmounted.png" and def.paramtype2 == "colorwallmounted" then param2 = newnode.param2 % 8 @@ -184,17 +181,21 @@ minetest.register_on_placenode( if param2 then minetest.swap_node(pos, {name = newnode.name, param2 = param2}) - minetest.get_meta(pos):set_int("palette_index", color) end end + + if def.palette ~= "" then + minetest.get_meta(pos):set_int("palette_index", param2 or 240) + end end ) -- The complementary function: strip-off the color if the node being dug is still white/neutral -local function move_item(item, pos, inv, digger) - if not (digger and digger:is_player()) then return end +local function move_item(item, pos, inv, digger, fix_color) + if not (digger and digger:is_player()) then return end local creative = creative_mode or minetest.check_player_privs(digger, "creative") + item = unifieddyes.fix_bad_color_info(item, fix_color) if inv:room_for_item("main", item) and (not creative or not inv:contains_item("main", item, true)) then inv:add_item("main", item) @@ -214,20 +215,21 @@ function unifieddyes.on_dig(pos, node, digger) local oldparam2 = minetest.get_node(pos).param2 local def = minetest.registered_items[node.name] - local del_color + local fix_color if def.paramtype2 == "color" and oldparam2 == 240 and def.palette == "unifieddyes_palette_extended.png" then - del_color = true + fix_color = 240 + elseif def.paramtype2 == "color" and oldparam2 == 0 and def.palette == "unifieddyes_palette_extended.png" then + fix_color = 0 elseif def.paramtype2 == "colorwallmounted" and math.floor(oldparam2 / 8) == 0 and def.palette == "unifieddyes_palette_colorwallmounted.png" then - del_color = true + fix_color = 0 elseif def.paramtype2 == "colorfacedir" and math.floor(oldparam2 / 32) == 0 and string.find(def.palette, "unifieddyes_palette_") then - del_color = true + fix_color = 0 end local inv = digger:get_inventory() - - if del_color then - move_item(node.name, pos, inv, digger) + if fix_color then + move_item(node.name, pos, inv, digger, fix_color) else return minetest.node_dig(pos, node, digger) end @@ -273,11 +275,14 @@ end -- This helper function creates a colored itemstack +function unifieddyes.fix_bad_color_info(item, paletteidx) + local stack=minetest.itemstring_with_color(item, paletteidx) + return string.gsub(stack, "u0001color", "u0001palette_index") +end + function unifieddyes.make_colored_itemstack(item, palette, color) local paletteidx = unifieddyes.getpaletteidx(color, palette) - local stack = ItemStack(item) - stack:get_meta():set_int("palette_index", paletteidx) - return stack:to_string(),paletteidx + return unifieddyes.fix_bad_color_info(item, paletteidx), paletteidx end -- these helper functions register all of the recipes needed to create colored