Page Menu
Home
1F616EMO Bugtracker
Search
Configure Global Search
Log In
Files
F171352
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/farming_mod/init.lua b/farming_mod/init.lua
index 2ab7995..1f02c9d 100644
--- a/farming_mod/init.lua
+++ b/farming_mod/init.lua
@@ -1,83 +1,92 @@
-- twi_mods/farming_mod/init.lua
-- Handle framing redo changes
--[[
The MIT License (MIT)
Copyright (c) 2016 TenPlus1
Copyright (c) 2024 1F616EMO
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]
if farming.mod ~= "redo" then
error("[twi_mods/farming_mod] Only works with Farming Redo")
end
-- Tomato red dye
minetest.register_craft({
output = farming.recipe_items.dye_red,
recipe = { { "group:food_tomato" } }
})
-- Allow planting pineapple
minetest.override_item("farming:pineapple", {
on_place = function(itemstack, placer, pointed_thing)
local under_pos = minetest.get_pointed_thing_position(pointed_thing)
if not under_pos then
return minetest.item_place(itemstack, placer, pointed_thing)
end
local under_name = minetest.get_node(under_pos).name
if under_name == "farming:pineapple_1"
or under_name == "farming:pineapple_2"
or under_name == "farming:pineapple_3"
or under_name == "farming:pineapple_4"
or under_name == "farming:pineapple_5"
or under_name == "farming:pineapple_6"
or under_name == "farming:pineapple_7"
or under_name == "farming:pineapple_8" then
return itemstack
elseif minetest.get_item_group(under_name, "soil") < 2 then
return minetest.item_place(itemstack, placer, pointed_thing)
end
local old_count = itemstack:get_count()
- itemstack = farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1")
- local consumed = old_count - itemstack:get_count()
+ local itemstack2 = farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1")
+ if not itemstack2 then return itemstack end
+ local consumed = old_count - itemstack2:get_count()
if consumed > 0 then
local ring_stack = ItemStack({ name = "farming:pineapple_ring", count = consumed * 5 })
if placer:is_player() then
local inv = placer:get_inventory()
ring_stack = inv:add_item("main", ring_stack)
end
local pos = minetest.get_pointed_thing_position(pointed_thing, true) or placer:get_pos()
minetest.add_item(pos, ring_stack)
end
- return itemstack
+ return itemstack2
end,
})
-- Temporary remove max light limit on rhubarb
farming.registered_plants["farming:rhubarb"].maxlight = nil
for _, stage in ipairs({ 1, 2, 3 }) do
minetest.override_item("farming:rhubarb_" .. stage, {
maxlight = minetest.LIGHT_MAX,
})
end
+
+-- Slice melons and pumkins on harvest
+minetest.override_item("farming:pumpkin_8", {
+ drop = "farming:pumpkin_slice 4",
+})
+minetest.override_item("farming:melon_8", {
+ drop = "farming:melon_slice 4",
+})
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Apr 12, 12:39 PM (1 w, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
84/24/f298d74bc6d94ef877ed34e0643e
Default Alt Text
(4 KB)
Attached To
Mode
rTWIMODS Survival Server Custom Modifications
Attached
Detach File
Event Timeline
Log In to Comment