Don't change water bottles when using in creative

Wuzzy 2019-02-08 23:55:49 +01:00
parent 46c7413337
commit 5b0945b88c

@ -76,6 +76,7 @@ minetest.register_craftitem("mcl_potions:glass_bottle", {
end
end
if get_water then
if minetest.settings:get_bool("creative_mode") ~= true then
-- Replace with water bottle, if possible, otherwise
-- place the water potion at a place where's space
local water_bottle
@ -84,7 +85,6 @@ minetest.register_craftitem("mcl_potions:glass_bottle", {
else
water_bottle = ItemStack("mcl_potions:potion_water")
end
minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
if itemstack:get_count() == 1 then
return water_bottle
else
@ -97,6 +97,8 @@ minetest.register_craftitem("mcl_potions:glass_bottle", {
itemstack:take_item()
end
end
minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
end
end
return itemstack
end,
@ -175,9 +177,13 @@ minetest.register_craftitem("mcl_potions:potion_water", {
-- Increase water level of cauldron by 1
minetest.set_node(pointed_thing.under, {name=cauldron})
minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
if minetest.settings:get_bool("creative_mode") == true then
return itemstack
else
return "mcl_potions:glass_bottle"
end
end
end
-- Drink the water by default
return minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, placer, pointed_thing)
@ -215,9 +221,13 @@ minetest.register_craftitem("mcl_potions:potion_river_water", {
-- Increase water level of cauldron by 1
minetest.set_node(pointed_thing.under, {name=cauldron})
minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
if minetest.settings:get_bool("creative_mode") == true then
return itemstack
else
return "mcl_potions:glass_bottle"
end
end
end
-- Drink the water by default
return minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, placer, pointed_thing)