diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index e47aabfc1e..26b57262dd 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -422,3 +422,8 @@ function mcl_potions.fire_resistance_func(player, duration) end + + +function mcl_potions.night_vision_func(player, duration) + player:override_day_night_ratio(0.45) +end diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index e3d86f9548..ff42768a7a 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -316,7 +316,7 @@ local output_table = { local enhancement_table = {} local extension_table = {} local potions = {"awkward", "mundane", "thick"} -for i, potion in ipairs({"healing","harming","swiftness","leaping","poison","regeneration","invisibility","weakness","water_breathing"}) do +for i, potion in ipairs({"healing","harming","swiftness","leaping","poison","regeneration","invisibility","weakness","water_breathing","night_vision"}) do table.insert(potions, potion) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 439cb5b9bc..57a2c6014d 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -152,10 +152,43 @@ minetest.register_craftitem("mcl_potions:harming_2", { minetest.register_craftitem("mcl_potions:night_vision", { description = S("Night Vision Potion"), _doc_items_longdesc = brewhelp, - wield_image = "mcl_potions_night_vision.png", - inventory_image = "mcl_potions_night_vision.png", + wield_image = potion_image("#009999"), + inventory_image = potion_image("#009999"), groups = { brewitem = 1, food=0}, stack_max = 1, + + on_place = function(itemstack, user, pointed_thing) + mcl_potions.night_vision_func(user, 180) + mcl_potions._use_potion(itemstack, user, "#009999") + return itemstack + end, + + on_secondary_use = function(itemstack, user, pointed_thing) + mcl_potions.night_vision_func(user, 180) + mcl_potions._use_potion(itemstack, user, "#009999") + return itemstack + end, +}) + +minetest.register_craftitem("mcl_potions:night_vision_plus", { + description = S("Night Vision Potion +"), + _doc_items_longdesc = brewhelp, + wield_image = potion_image("#000A0A"), + inventory_image = potion_image("#000A0A"), + groups = { brewitem = 1, food=0}, + stack_max = 1, + + on_place = function(itemstack, user, pointed_thing) + mcl_potions.night_vision_func(user, 480) + mcl_potions._use_potion(itemstack, user, "#000A0A") + return itemstack + end, + + on_secondary_use = function(itemstack, user, pointed_thing) + mcl_potions.night_vision_func(user, 480) + mcl_potions._use_potion(itemstack, user, "#000A0A") + return itemstack + end, }) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 95efa8bde4..0f60342df2 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -196,3 +196,11 @@ register_splash("water_breathing_plus", "Splash Fire Resistance", "#D0A040", { register_splash("water_breathing_plus", "Splash Fire Resistance +", "#E0B050", { potion_fun = function(player, redx) mcl_potions.fire_resistance_func(player, 360*redx) end }) + +register_splash("night_vision", "Splash Night Vision", "#009999", { + potion_fun = function(player, redx) mcl_potions.night_vision_func(player, 135*redx) end +}) + +register_splash("night_vision_plus", "Splash Night Vision +", "#000A0A", { + potion_fun = function(player, redx) mcl_potions.night_vision_func(player, 360*redx) end +}) diff --git a/mods/ITEMS/mcl_potions/textures/hb_potion_bar.png b/mods/ITEMS/mcl_potions/textures/hb_potion_bar.png deleted file mode 100644 index ce0aa78ec1..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/hb_potion_bar.png and /dev/null differ diff --git a/mods/ITEMS/mcl_potions/textures/hb_swiftness_bgicon.png b/mods/ITEMS/mcl_potions/textures/hb_swiftness_bgicon.png deleted file mode 100644 index b01f148599..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/hb_swiftness_bgicon.png and /dev/null differ diff --git a/mods/ITEMS/mcl_potions/textures/hb_swiftness_icon.png b/mods/ITEMS/mcl_potions/textures/hb_swiftness_icon.png deleted file mode 100644 index 5c85ae1779..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/hb_swiftness_icon.png and /dev/null differ diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_healing.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_healing.png deleted file mode 100644 index 66bdbe0065..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/mcl_potions_healing.png and /dev/null differ diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_night_vision.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_night_vision.png deleted file mode 100644 index 9a4ee688c9..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/mcl_potions_night_vision.png and /dev/null differ diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_swiftness.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_swiftness.png deleted file mode 100644 index 4dbf788a61..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/mcl_potions_swiftness.png and /dev/null differ diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_weakness.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_weakness.png deleted file mode 100644 index 524ebeea6a..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/mcl_potions_weakness.png and /dev/null differ