mirror of
				https://github.com/sys4-fr/server-nalc.git
				synced 2025-11-04 05:55:28 +01:00 
			
		
		
		
	Implementation of multiple buckets handler
- Uncommented and changed a bit the lines of Casimir's redefinition of bucket:bucket_empty in ./minetestforfun_game/mods/bucket/init.lua to implement multiple buckets handle system, commented in an old commit (it was buggy, or something). The system has been modified a bit to prevent bugs from incompatibility between carbone's api (which the definition has been copied from) and minetestforfun_game's one.
This commit is contained in:
		@@ -135,11 +135,10 @@ minetest.register_craftitem(":bucket:bucket_empty", {
 | 
			
		||||
			-- Stacked buckets: add a filled bucket, replace stack.
 | 
			
		||||
			local inv = user:get_inventory()
 | 
			
		||||
			if inv:room_for_item("main", liquiddef.itemname) then
 | 
			
		||||
				minetest.add_node(pointed_thing.under, {name="air"})
 | 
			
		||||
				--count = count - 1
 | 
			
		||||
				--itemstack:set_count(count)
 | 
			
		||||
				return ItemStack(liquiddef.itemname)
 | 
			
		||||
				--inv:add_item("main", bucket_liquid)
 | 
			
		||||
				count = count - 1
 | 
			
		||||
				itemstack:set_count(count)
 | 
			
		||||
				inv:add_item("main", liquiddef.itemname)
 | 
			
		||||
				return ItemStack(itemstack)
 | 
			
		||||
			else
 | 
			
		||||
				minetest.chat_send_player(user:get_player_name(), "Your inventory is full.")
 | 
			
		||||
			end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user